Compare commits
83 Commits
Author | SHA1 | Date |
---|---|---|
Benjamin Port | 5290583f8a | |
Méven Car | a7aa089ec4 | |
l10n daemon script | de4e429aed | |
Xaver Hugl | b50f747876 | |
l10n daemon script | 1f6e615ec0 | |
Ismael Asensio | 715f0dbbcc | |
Andreas Hartmetz | 9d77271011 | |
Vlad Zahorodnii | 0e7b02bc73 | |
Vlad Zahorodnii | 005377eff7 | |
Vlad Zahorodnii | 0f9722ad69 | |
David Edmundson | 56f159dded | |
Nicolas Fella | 3694580e2b | |
Vlad Zahorodnii | bf4c67678f | |
Vlad Zahorodnii | 1e9bd43368 | |
Vlad Zahorodnii | 1251b2cbb3 | |
Vlad Zahorodnii | faf6b8e049 | |
Cyril Rossi | a3caf7f6dd | |
Albert Astals Cid | 743b06d3a1 | |
Nicolas Fella | abca052004 | |
Bhushan Shah | 0a3e18e5a6 | |
Bhushan Shah | 474d0344ca | |
Méven Car | 309a656e00 | |
Cyril Rossi | 99bed106bf | |
l10n daemon script | 30b516eceb | |
Bhushan Shah | 222b558b04 | |
Aleix Pol | f558115def | |
Andrey Butirsky | db202f5c26 | |
Andrey Butirsky | 2bbab06fc4 | |
Andrey Butirsky | 769c8959d8 | |
Vlad Zahorodnii | 4559d30399 | |
Vlad Zahorodnii | 6546ac2cae | |
Vlad Zahorodnii | 6f153552da | |
Vlad Zahorodnii | ddb24eaf0a | |
Vlad Zahorodnii | 12e59f9af8 | |
Bhushan Shah | 6d433bdfc9 | |
Vlad Zahorodnii | a433fb08a3 | |
David Edmundson | 260e75f6c9 | |
l10n daemon script | cd9acd2e41 | |
Carson Black | fbab964e98 | |
Carson Black | 02b1e11758 | |
Aleix Pol | 309d6a0d5b | |
Vlad Zahorodnii | 688dc9ac1d | |
l10n daemon script | 25b93b4ccc | |
l10n daemon script | e534d5abad | |
Aleix Pol | 375691c6c2 | |
Felix Yan | a58100fc72 | |
Vlad Zahorodnii | f24f2bd509 | |
Vlad Zahorodnii | 989e0987d7 | |
Vlad Zahorodnii | 80554a3e12 | |
David Edmundson | 095cdcd374 | |
Vlad Zahorodnii | 75cad57cd9 | |
Andreas Haratzis | 6f53f62741 | |
Andreas Haratzis | 1dbe3708f5 | |
Vlad Zahorodnii | 0c266e760b | |
Vlad Zahorodnii | 70b18ae404 | |
l10n daemon script | 102332df00 | |
Vlad Zahorodnii | 70700b868a | |
Vlad Zahorodnii | bc34736534 | |
Vlad Zahorodnii | 960a40ef44 | |
Vlad Zahorodnii | 989699a273 | |
Vlad Zahorodnii | 22cf80c466 | |
Aleix Pol | 9479c0d6b4 | |
Aleix Pol | 13dcb46888 | |
Aleix Pol | 097caa64a5 | |
Aleix Pol | f1233a641d | |
Bhushan Shah | 0e05f4e4c2 | |
Adrien Faveraux | c0f9ed3400 | |
Vlad Zahorodnii | 90dce019ad | |
Aleix Pol | 870b411015 | |
Aleix Pol | 61e655f7f7 | |
Aleix Pol | 26950a65a6 | |
Bhushan Shah | fd917b4e00 | |
Vlad Zahorodnii | 5f7d23fd07 | |
Vlad Zahorodnii | 99dd5d94c5 | |
Vlad Zahorodnii | 3d0042e05b | |
Bhushan Shah | 426e7f910d | |
l10n daemon script | 240c77a934 | |
David Edmundson | 578287ec95 | |
l10n daemon script | 3cfec5fdcf | |
Andreas Haratzis | 71dfd60284 | |
Tiago Corrêa | 2e93829259 | |
Vlad Zahorodnii | 79c667ea67 | |
l10n daemon script | e6e72d27b9 |
|
@ -285,10 +285,11 @@ _XcursorReadUInt (XcursorFile *file, XcursorUInt *u)
|
|||
|
||||
if ((*file->read) (file, bytes, 4) != 4)
|
||||
return XcursorFalse;
|
||||
*u = ((bytes[0] << 0) |
|
||||
(bytes[1] << 8) |
|
||||
(bytes[2] << 16) |
|
||||
(bytes[3] << 24));
|
||||
|
||||
*u = ((XcursorUInt)(bytes[0]) << 0) |
|
||||
((XcursorUInt)(bytes[1]) << 8) |
|
||||
((XcursorUInt)(bytes[2]) << 16) |
|
||||
((XcursorUInt)(bytes[3]) << 24);
|
||||
return XcursorTrue;
|
||||
}
|
||||
|
||||
|
|
|
@ -30,8 +30,10 @@
|
|||
extern "C" {
|
||||
#endif
|
||||
|
||||
#include <stdint.h>
|
||||
|
||||
typedef int XcursorBool;
|
||||
typedef unsigned int XcursorUInt;
|
||||
typedef uint32_t XcursorUInt;
|
||||
|
||||
typedef XcursorUInt XcursorDim;
|
||||
typedef XcursorUInt XcursorPixel;
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
cmake_minimum_required(VERSION 3.1 FATAL_ERROR)
|
||||
|
||||
project(KWin)
|
||||
set(PROJECT_VERSION "5.19.90")
|
||||
set(PROJECT_VERSION "5.20.80")
|
||||
set(PROJECT_VERSION_MAJOR 5)
|
||||
|
||||
set(QT_MIN_VERSION "5.15.0")
|
||||
|
@ -52,7 +52,7 @@ include(ECMConfiguredInstall)
|
|||
|
||||
add_definitions(-DQT_DISABLE_DEPRECATED_BEFORE=0 -DQT_USE_QSTRINGBUILDER -DQT_NO_URL_CAST_FROM_STRING)
|
||||
|
||||
set(CMAKE_CXX_STANDARD 14)
|
||||
set(CMAKE_CXX_STANDARD 17)
|
||||
set(CMAKE_CXX_STANDARD_REQUIRED ON)
|
||||
|
||||
find_package(Qt5Multimedia QUIET)
|
||||
|
@ -114,7 +114,7 @@ add_feature_info("KF5DocTools" KF5DocTools_FOUND "Enable building documentation"
|
|||
find_package(KF5Kirigami2 ${KF5_MIN_VERSION} CONFIG)
|
||||
set_package_properties(KF5Kirigami2 PROPERTIES
|
||||
DESCRIPTION "A QtQuick based components set"
|
||||
PURPOSE "Required at runtime for Virtual desktop KCM and the virtual keyboard"
|
||||
PURPOSE "Required at runtime for Virtual desktop KCM"
|
||||
TYPE RUNTIME
|
||||
)
|
||||
|
||||
|
@ -322,7 +322,6 @@ include(ECMQMLModules)
|
|||
ecm_find_qmlmodule(QtQuick 2.3)
|
||||
ecm_find_qmlmodule(QtQuick.Controls 1.2)
|
||||
ecm_find_qmlmodule(QtQuick.Layouts 1.3)
|
||||
ecm_find_qmlmodule(QtQuick.VirtualKeyboard 2.1)
|
||||
ecm_find_qmlmodule(QtQuick.Window 2.1)
|
||||
ecm_find_qmlmodule(QtMultimedia 5.0)
|
||||
ecm_find_qmlmodule(org.kde.kquickcontrolsaddons 2.0)
|
||||
|
@ -468,6 +467,7 @@ set(kwin_SRCS
|
|||
input.cpp
|
||||
input_event.cpp
|
||||
input_event_spy.cpp
|
||||
inputmethod.cpp
|
||||
inputpanelv1client.cpp
|
||||
inputpanelv1integration.cpp
|
||||
internal_client.cpp
|
||||
|
@ -532,7 +532,6 @@ set(kwin_SRCS
|
|||
utils.cpp
|
||||
virtualdesktops.cpp
|
||||
virtualdesktopsdbustypes.cpp
|
||||
virtualkeyboard.cpp
|
||||
virtualkeyboard_dbus.cpp
|
||||
was_user_interaction_x11_filter.cpp
|
||||
wayland_server.cpp
|
||||
|
|
|
@ -236,6 +236,7 @@ void AbstractClient::markAsZombie()
|
|||
{
|
||||
Q_ASSERT(!m_zombie);
|
||||
m_zombie = true;
|
||||
addWorkspaceRepaint(visibleRect());
|
||||
}
|
||||
|
||||
Layer AbstractClient::layer() const
|
||||
|
|
|
@ -79,6 +79,11 @@ class KWIN_EXPORT AbstractClient : public Toplevel
|
|||
*/
|
||||
Q_PROPERTY(bool onAllDesktops READ isOnAllDesktops WRITE setOnAllDesktops NOTIFY desktopChanged)
|
||||
|
||||
/**
|
||||
* The activities this client is on. If it's on all activities the property is empty.
|
||||
*/
|
||||
Q_PROPERTY(QStringList activities READ activities WRITE setOnActivities NOTIFY activitiesChanged)
|
||||
|
||||
/**
|
||||
* The x11 ids for all desktops this client is in. On X11 this list will always have a length of 1
|
||||
*/
|
||||
|
@ -884,6 +889,7 @@ Q_SIGNALS:
|
|||
void demandsAttentionChanged();
|
||||
void desktopPresenceChanged(KWin::AbstractClient*, int); // to be forwarded by Workspace
|
||||
void desktopChanged();
|
||||
void activitiesChanged(KWin::AbstractClient* client);
|
||||
void x11DesktopIdsChanged();
|
||||
void shadeChanged();
|
||||
void minimizedChanged();
|
||||
|
|
|
@ -13,6 +13,10 @@ ecm_add_qtwayland_client_protocol(KWinIntegrationTestFramework_SOURCES
|
|||
PROTOCOL ${WaylandProtocols_DATADIR}/unstable/input-method/input-method-unstable-v1.xml
|
||||
BASENAME input-method-unstable-v1
|
||||
)
|
||||
ecm_add_qtwayland_client_protocol(KWinIntegrationTestFramework_SOURCES
|
||||
PROTOCOL ${WaylandProtocols_DATADIR}/unstable/text-input/text-input-unstable-v3.xml
|
||||
BASENAME text-input-unstable-v3
|
||||
)
|
||||
ecm_add_qtwayland_client_protocol(KWinIntegrationTestFramework_SOURCES
|
||||
PROTOCOL protocols/wlr-layer-shell-unstable-v1.xml
|
||||
BASENAME wlr-layer-shell-unstable-v1
|
||||
|
@ -82,7 +86,7 @@ integrationTest(WAYLAND_ONLY NAME testNoGlobalShortcuts SRCS no_global_shortcuts
|
|||
integrationTest(WAYLAND_ONLY NAME testBufferSizeChange SRCS buffer_size_change_test.cpp )
|
||||
integrationTest(WAYLAND_ONLY NAME testPlacement SRCS placement_test.cpp)
|
||||
integrationTest(WAYLAND_ONLY NAME testActivation SRCS activation_test.cpp)
|
||||
integrationTest(WAYLAND_ONLY NAME testVirtualKeyboard SRCS virtualkeyboard_test.cpp)
|
||||
integrationTest(WAYLAND_ONLY NAME testInputMethod SRCS inputmethod_test.cpp)
|
||||
|
||||
if (XCB_ICCCM_FOUND)
|
||||
integrationTest(NAME testMoveResize SRCS move_resize_window_test.cpp LIBS XCB::ICCCM)
|
||||
|
|
|
@ -15,9 +15,10 @@
|
|||
#include "screens.h"
|
||||
#include "wayland_server.h"
|
||||
#include "workspace.h"
|
||||
#include "virtualkeyboard.h"
|
||||
#include "inputmethod.h"
|
||||
#include "virtualkeyboard_dbus.h"
|
||||
#include "qwayland-input-method-unstable-v1.h"
|
||||
#include "qwayland-text-input-unstable-v3.h"
|
||||
|
||||
#include <QTest>
|
||||
#include <QSignalSpy>
|
||||
|
@ -33,14 +34,15 @@
|
|||
#include <KWayland/Client/surface.h>
|
||||
#include <KWayland/Client/xdgshell.h>
|
||||
#include <KWayland/Client/textinput.h>
|
||||
#include <KWayland/Client/seat.h>
|
||||
|
||||
using namespace KWin;
|
||||
using namespace KWayland::Client;
|
||||
using KWin::VirtualKeyboardDBus;
|
||||
|
||||
static const QString s_socketName = QStringLiteral("wayland_test_kwin_virtualkeyboard-0");
|
||||
static const QString s_socketName = QStringLiteral("wayland_test_kwin_inputmethod-0");
|
||||
|
||||
class VirtualKeyboardTest : public QObject
|
||||
class InputMethodTest : public QObject
|
||||
{
|
||||
Q_OBJECT
|
||||
private Q_SLOTS:
|
||||
|
@ -49,10 +51,11 @@ private Q_SLOTS:
|
|||
void cleanup();
|
||||
|
||||
void testOpenClose();
|
||||
void testEnableDisableV3();
|
||||
};
|
||||
|
||||
|
||||
void VirtualKeyboardTest::initTestCase()
|
||||
void InputMethodTest::initTestCase()
|
||||
{
|
||||
qRegisterMetaType<KWin::Deleted *>();
|
||||
qRegisterMetaType<KWin::AbstractClient *>();
|
||||
|
@ -74,10 +77,12 @@ void VirtualKeyboardTest::initTestCase()
|
|||
|
||||
}
|
||||
|
||||
void VirtualKeyboardTest::init()
|
||||
void InputMethodTest::init()
|
||||
{
|
||||
QVERIFY(Test::setupWaylandConnection(Test::AdditionalWaylandInterface::Seat |
|
||||
Test::AdditionalWaylandInterface::TextInputManagerV2 | Test::AdditionalWaylandInterface::InputMethodV1));
|
||||
Test::AdditionalWaylandInterface::TextInputManagerV2 |
|
||||
Test::AdditionalWaylandInterface::InputMethodV1 |
|
||||
Test::AdditionalWaylandInterface::TextInputManagerV3));
|
||||
|
||||
|
||||
screens()->setCurrent(0);
|
||||
|
@ -90,12 +95,12 @@ void VirtualKeyboardTest::init()
|
|||
QDBusConnection::sessionBus().call(message);
|
||||
}
|
||||
|
||||
void VirtualKeyboardTest::cleanup()
|
||||
void InputMethodTest::cleanup()
|
||||
{
|
||||
Test::destroyWaylandConnection();
|
||||
}
|
||||
|
||||
void VirtualKeyboardTest::testOpenClose()
|
||||
void InputMethodTest::testOpenClose()
|
||||
{
|
||||
QSignalSpy clientAddedSpy(workspace(), &Workspace::clientAdded);
|
||||
QSignalSpy clientRemovedSpy(workspace(), &Workspace::clientRemoved);
|
||||
|
@ -149,6 +154,40 @@ void VirtualKeyboardTest::testOpenClose()
|
|||
QVERIFY(Test::waitForWindowDestroyed(client));
|
||||
}
|
||||
|
||||
WAYLANDTEST_MAIN(VirtualKeyboardTest)
|
||||
void InputMethodTest::testEnableDisableV3()
|
||||
{
|
||||
QSignalSpy clientAddedSpy(workspace(), &Workspace::clientAdded);
|
||||
QSignalSpy clientRemovedSpy(workspace(), &Workspace::clientRemoved);
|
||||
QVERIFY(clientAddedSpy.isValid());
|
||||
|
||||
#include "virtualkeyboard_test.moc"
|
||||
// Create an xdg_toplevel surface and wait for the compositor to catch up.
|
||||
QScopedPointer<Surface> surface(Test::createSurface());
|
||||
QScopedPointer<XdgShellSurface> shellSurface(Test::createXdgShellStableSurface(surface.data()));
|
||||
AbstractClient *client = Test::renderAndWaitForShown(surface.data(), QSize(1280, 1024), Qt::red);
|
||||
QVERIFY(client);
|
||||
QVERIFY(client->isActive());
|
||||
QCOMPARE(client->frameGeometry().size(), QSize(1280, 1024));
|
||||
|
||||
Test::TextInputV3 *textInputV3 = new Test::TextInputV3();
|
||||
textInputV3->init(Test::waylandTextInputManagerV3()->get_text_input(*(Test::waylandSeat())));
|
||||
textInputV3->enable();
|
||||
// just enabling the text-input should not show it but rather on commit
|
||||
QVERIFY(!clientAddedSpy.wait(100));
|
||||
|
||||
textInputV3->commit();
|
||||
|
||||
QVERIFY(clientAddedSpy.wait());
|
||||
AbstractClient *keyboardClient = clientAddedSpy.last().first().value<AbstractClient *>();
|
||||
QVERIFY(keyboardClient);
|
||||
QVERIFY(keyboardClient->isInputMethod());
|
||||
|
||||
// disable text input and ensure that it is not hiding input panel without commit
|
||||
textInputV3->disable();
|
||||
QVERIFY(!clientRemovedSpy.wait(100));
|
||||
textInputV3->commit();
|
||||
QVERIFY(clientRemovedSpy.wait());
|
||||
}
|
||||
|
||||
WAYLANDTEST_MAIN(InputMethodTest)
|
||||
|
||||
#include "inputmethod_test.moc"
|
|
@ -14,7 +14,7 @@
|
|||
#include "../../workspace.h"
|
||||
#include "../../xcbutils.h"
|
||||
#include "../../xwl/xwayland.h"
|
||||
#include "../../virtualkeyboard.h"
|
||||
#include "../../inputmethod.h"
|
||||
|
||||
#include <KPluginMetaData>
|
||||
|
||||
|
@ -87,7 +87,7 @@ WaylandTestApplication::~WaylandTestApplication()
|
|||
void WaylandTestApplication::performStartup()
|
||||
{
|
||||
if (!m_inputMethodServerToStart.isEmpty()) {
|
||||
VirtualKeyboard::create();
|
||||
InputMethod::create();
|
||||
if (m_inputMethodServerToStart != QStringLiteral("internal")) {
|
||||
int socket = dup(waylandServer()->createInputMethodConnection());
|
||||
if (socket >= 0) {
|
||||
|
|
|
@ -18,6 +18,7 @@
|
|||
#include <KWayland/Client/xdgshell.h>
|
||||
|
||||
#include "qwayland-wlr-layer-shell-unstable-v1.h"
|
||||
#include "qwayland-text-input-unstable-v3.h"
|
||||
#include "qwayland-xdg-shell.h"
|
||||
|
||||
namespace KWayland
|
||||
|
@ -47,6 +48,8 @@ class TextInputManager;
|
|||
namespace QtWayland
|
||||
{
|
||||
class zwp_input_panel_surface_v1;
|
||||
class zwp_text_input_v3;
|
||||
class zwp_text_input_manager_v3;
|
||||
}
|
||||
|
||||
namespace KWin
|
||||
|
@ -86,6 +89,17 @@ namespace Test
|
|||
|
||||
class MockInputMethod;
|
||||
|
||||
class TextInputManagerV3 : public QtWayland::zwp_text_input_manager_v3
|
||||
{
|
||||
public:
|
||||
~TextInputManagerV3() override { destroy(); }
|
||||
};
|
||||
|
||||
class TextInputV3 : public QtWayland::zwp_text_input_v3
|
||||
{
|
||||
~TextInputV3() override { destroy(); }
|
||||
};
|
||||
|
||||
class LayerShellV1 : public QtWayland::zwlr_layer_shell_v1
|
||||
{
|
||||
public:
|
||||
|
@ -222,6 +236,7 @@ enum class AdditionalWaylandInterface {
|
|||
TextInputManagerV2 = 1 << 10,
|
||||
InputMethodV1 = 1 << 11,
|
||||
LayerShellV1 = 1 << 12,
|
||||
TextInputManagerV3 = 1 << 13
|
||||
};
|
||||
Q_DECLARE_FLAGS(AdditionalWaylandInterfaces, AdditionalWaylandInterface)
|
||||
/**
|
||||
|
@ -272,6 +287,8 @@ LayerSurfaceV1 *createLayerSurfaceV1(KWayland::Client::Surface *surface,
|
|||
KWayland::Client::Output *output = nullptr,
|
||||
LayerShellV1::layer layer = LayerShellV1::layer_top);
|
||||
|
||||
TextInputManagerV3 *waylandTextInputManagerV3();
|
||||
|
||||
enum class CreationSetup {
|
||||
CreateOnly,
|
||||
CreateAndConfigure, /// commit and wait for the configure event, making this surface ready to commit buffers
|
||||
|
|
|
@ -370,6 +370,7 @@ void PlasmaSurfaceTest::testPanelWindowsCanCover()
|
|||
// trigger screenedge
|
||||
QFETCH(QPoint, triggerPoint);
|
||||
KWin::Cursors::self()->mouse()->setPos(triggerPoint);
|
||||
QVERIFY(stackingOrderChangedSpy.wait());
|
||||
QCOMPARE(stackingOrderChangedSpy.count(), 1);
|
||||
stackingOrder = workspace()->stackingOrder();
|
||||
QCOMPARE(stackingOrder.count(), 2);
|
||||
|
|
|
@ -12,7 +12,7 @@
|
|||
#include "wayland_server.h"
|
||||
#include "workspace.h"
|
||||
#include "qwayland-input-method-unstable-v1.h"
|
||||
#include "virtualkeyboard.h"
|
||||
#include "inputmethod.h"
|
||||
|
||||
#include <KWayland/Client/compositor.h>
|
||||
#include <KWayland/Client/connection_thread.h>
|
||||
|
@ -208,6 +208,7 @@ static struct {
|
|||
MockInputMethod *inputMethodV1 = nullptr;
|
||||
QtWayland::zwp_input_method_context_v1 *inputMethodContextV1 = nullptr;
|
||||
LayerShellV1 *layerShellV1 = nullptr;
|
||||
TextInputManagerV3 *textInputManagerV3 = nullptr;
|
||||
} s_waylandConnection;
|
||||
|
||||
class MockInputMethod : public QtWayland::zwp_input_method_v1
|
||||
|
@ -323,6 +324,13 @@ bool setupWaylandConnection(AdditionalWaylandInterfaces flags)
|
|||
s_waylandConnection.layerShellV1->init(*registry, name, version);
|
||||
}
|
||||
}
|
||||
if (flags & AdditionalWaylandInterface::TextInputManagerV3) {
|
||||
// do something
|
||||
if (interface == QByteArrayLiteral("zwp_text_input_manager_v3")) {
|
||||
s_waylandConnection.textInputManagerV3 = new TextInputManagerV3();
|
||||
s_waylandConnection.textInputManagerV3->init(*registry, name, version);
|
||||
}
|
||||
}
|
||||
if (interface == QByteArrayLiteral("xdg_wm_base")) {
|
||||
s_waylandConnection.xdgShell = new XdgShell();
|
||||
s_waylandConnection.xdgShell->init(*registry, name, version);
|
||||
|
@ -566,6 +574,11 @@ TextInputManager *waylandTextInputManager()
|
|||
return s_waylandConnection.textInputManager;
|
||||
}
|
||||
|
||||
TextInputManagerV3 *waylandTextInputManagerV3()
|
||||
{
|
||||
return s_waylandConnection.textInputManagerV3;
|
||||
}
|
||||
|
||||
QVector<KWayland::Client::Output *> waylandOutputs()
|
||||
{
|
||||
return s_waylandConnection.outputs;
|
||||
|
|
|
@ -632,7 +632,7 @@ void TestXdgShellClient::testWindowOpensLargerThanScreen()
|
|||
// the window should get resized to fit into the screen, BUG: 366632
|
||||
QScopedPointer<Surface> surface(Test::createSurface());
|
||||
QScopedPointer<XdgShellSurface> shellSurface(Test::createXdgShellStableSurface(surface.data()));
|
||||
QSignalSpy sizeChangeRequestedSpy(shellSurface.data(), SIGNAL(sizeChanged(QSize)));
|
||||
QSignalSpy sizeChangeRequestedSpy(shellSurface.data(), &XdgShellSurface::sizeChanged);
|
||||
QVERIFY(sizeChangeRequestedSpy.isValid());
|
||||
|
||||
// create deco
|
||||
|
|
|
@ -50,10 +50,10 @@ GetAddrInfo::GetAddrInfo(const QByteArray &hostName, QObject *parent)
|
|||
{
|
||||
// watcher will be deleted together with the GetAddrInfo once the future
|
||||
// got canceled or finished
|
||||
connect(m_watcher, SIGNAL(canceled()), SLOT(deleteLater()));
|
||||
connect(m_watcher, SIGNAL(finished()), SLOT(slotResolved()));
|
||||
connect(m_ownAddressWatcher, SIGNAL(canceled()), SLOT(deleteLater()));
|
||||
connect(m_ownAddressWatcher, SIGNAL(finished()), SLOT(slotOwnAddressResolved()));
|
||||
connect(m_watcher, &QFutureWatcher<int>::canceled, this, &GetAddrInfo::deleteLater);
|
||||
connect(m_watcher, &QFutureWatcher<int>::finished, this, &GetAddrInfo::slotResolved);
|
||||
connect(m_ownAddressWatcher, &QFutureWatcher<int>::canceled, this, &GetAddrInfo::deleteLater);
|
||||
connect(m_ownAddressWatcher, &QFutureWatcher<int>::finished, this, &GetAddrInfo::slotOwnAddressResolved);
|
||||
}
|
||||
|
||||
GetAddrInfo::~GetAddrInfo()
|
||||
|
@ -210,8 +210,8 @@ void ClientMachine::checkForLocalhost()
|
|||
// check using information from get addr info
|
||||
// GetAddrInfo gets automatically destroyed once it finished or not
|
||||
GetAddrInfo *info = new GetAddrInfo(lowerHostName, this);
|
||||
connect(info, SIGNAL(local()), SLOT(setLocal()));
|
||||
connect(info, SIGNAL(destroyed(QObject*)), SLOT(resolveFinished()));
|
||||
connect(info, &GetAddrInfo::local, this, &ClientMachine::setLocal);
|
||||
connect(info, &GetAddrInfo::destroyed, this, &ClientMachine::resolveFinished);
|
||||
info->resolve();
|
||||
}
|
||||
}
|
||||
|
|
|
@ -617,7 +617,7 @@ void Compositor::performCompositing()
|
|||
|
||||
// Reset the damage state of each window and fetch the damage region
|
||||
// without waiting for a reply
|
||||
for (Toplevel *win : windows) {
|
||||
for (Toplevel *win : qAsConst(windows)) {
|
||||
if (win->resetAndFetchDamage()) {
|
||||
damaged << win;
|
||||
}
|
||||
|
@ -638,7 +638,7 @@ void Compositor::performCompositing()
|
|||
}
|
||||
|
||||
// Get the replies
|
||||
for (Toplevel *win : damaged) {
|
||||
for (Toplevel *win : qAsConst(damaged)) {
|
||||
// Discard the cached lanczos texture
|
||||
if (win->effectWindow()) {
|
||||
const QVariant texture = win->effectWindow()->data(LanczosCacheRole);
|
||||
|
|
|
@ -22,3 +22,4 @@ kwin_scene_xrender KWin XRender based compositor scene plugin DEFAULT_SEVERITY [
|
|||
kwin_scene_qpainter KWin QPainter based compositor scene plugin DEFAULT_SEVERITY [CRITICAL] IDENTIFIER [KWIN_QPAINTER]
|
||||
kwin_scene_opengl KWin OpenGL based compositor scene plugins DEFAULT_SEVERITY [CRITICAL] IDENTIFIER [KWIN_OPENGL]
|
||||
kwin_screencast KWin Screen Cast Service DEFAULT_SEVERITY [WARNING] IDENTIFIER [KWIN_SCREENCAST]
|
||||
kwin_xwl KWin Xwayland Server DEFAULT_SEVERITY [WARNING] IDENTIFIER [KWIN_XWL]
|
||||
|
|
|
@ -49,7 +49,7 @@ DBusInterface::DBusInterface(QObject *parent)
|
|||
}
|
||||
if (!dbus.registerService(m_serviceName)) {
|
||||
QDBusServiceWatcher *dog = new QDBusServiceWatcher(m_serviceName, dbus, QDBusServiceWatcher::WatchForUnregistration, this);
|
||||
connect (dog, SIGNAL(serviceUnregistered(QString)), SLOT(becomeKWinService(QString)));
|
||||
connect(dog, &QDBusServiceWatcher::serviceUnregistered, this, &DBusInterface::becomeKWinService);
|
||||
} else {
|
||||
announceService();
|
||||
}
|
||||
|
|
|
@ -15,10 +15,10 @@
|
|||
#include "scene.h"
|
||||
#include "unmanaged.h"
|
||||
#include "waylandclient.h"
|
||||
#include "wayland_server.h"
|
||||
#include "workspace.h"
|
||||
#include "keyboard_input.h"
|
||||
#include "input_event.h"
|
||||
#include "subsurfacemonitor.h"
|
||||
#include "libinput/connection.h"
|
||||
#include "libinput/device.h"
|
||||
#include <kwinglplatform.h>
|
||||
|
@ -863,14 +863,8 @@ void DebugConsoleModel::remove(int parentRow, QVector<T*> &clients, T *client)
|
|||
DebugConsoleModel::DebugConsoleModel(QObject *parent)
|
||||
: QAbstractItemModel(parent)
|
||||
{
|
||||
if (waylandServer()) {
|
||||
const auto clients = waylandServer()->clients();
|
||||
for (auto c : clients) {
|
||||
handleClientAdded(c);
|
||||
}
|
||||
}
|
||||
const auto x11Clients = workspace()->clientList();
|
||||
for (auto c : x11Clients) {
|
||||
const auto clients = workspace()->allClientList();
|
||||
for (auto c : clients) {
|
||||
handleClientAdded(c);
|
||||
}
|
||||
connect(workspace(), &Workspace::clientAdded, this, &DebugConsoleModel::handleClientAdded);
|
||||
|
@ -1267,36 +1261,27 @@ SurfaceTreeModel::SurfaceTreeModel(QObject *parent)
|
|||
};
|
||||
using namespace KWaylandServer;
|
||||
|
||||
const auto unmangeds = workspace()->unmanagedList();
|
||||
for (auto u : unmangeds) {
|
||||
if (!u->surface()) {
|
||||
continue;
|
||||
}
|
||||
connect(u->surface(), &SurfaceInterface::subSurfaceTreeChanged, this, reset);
|
||||
}
|
||||
for (auto c : workspace()->allClientList()) {
|
||||
auto watchSubsurfaces = [this, reset](AbstractClient *c) {
|
||||
if (!c->surface()) {
|
||||
continue;
|
||||
return;
|
||||
}
|
||||
connect(c->surface(), &SurfaceInterface::subSurfaceTreeChanged, this, reset);
|
||||
auto monitor = new SubSurfaceMonitor(c->surface(), this);
|
||||
connect(monitor, &SubSurfaceMonitor::subSurfaceAdded, this, reset);
|
||||
connect(monitor, &SubSurfaceMonitor::subSurfaceRemoved, this, reset);
|
||||
connect (c, &QObject::destroyed, monitor, &QObject::deleteLater);
|
||||
};
|
||||
|
||||
for (auto c : workspace()->allClientList()) {
|
||||
watchSubsurfaces(c);
|
||||
}
|
||||
connect(workspace(), &Workspace::clientAdded, this,
|
||||
[this, reset] (AbstractClient *c) {
|
||||
if (c->surface()) {
|
||||
connect(c->surface(), &SurfaceInterface::subSurfaceTreeChanged, this, reset);
|
||||
}
|
||||
[this, reset, watchSubsurfaces] (AbstractClient *c) {
|
||||
watchSubsurfaces(c);
|
||||
reset();
|
||||
}
|
||||
);
|
||||
connect(workspace(), &Workspace::clientRemoved, this, reset);
|
||||
connect(workspace(), &Workspace::unmanagedAdded, this,
|
||||
[this, reset] (Unmanaged *u) {
|
||||
if (u->surface()) {
|
||||
connect(u->surface(), &SurfaceInterface::subSurfaceTreeChanged, this, reset);
|
||||
}
|
||||
reset();
|
||||
}
|
||||
);
|
||||
connect(workspace(), &Workspace::unmanagedAdded, this, reset);
|
||||
connect(workspace(), &Workspace::unmanagedRemoved, this, reset);
|
||||
}
|
||||
|
||||
|
|
|
@ -5,6 +5,7 @@
|
|||
SPDX-FileCopyrightText: 2014 Martin Gräßlin <mgraesslin@kde.org>
|
||||
SPDX-FileCopyrightText: 2014 Hugo Pereira Da Costa <hugo.pereira@free.fr>
|
||||
SPDX-FileCopyrightText: 2015 Mika Allan Rauhala <mika.allan.rauhala@gmail.com>
|
||||
SPDX-FileCopyrightText: 2020 Carson Black <uhhadd@gmail.com>
|
||||
|
||||
SPDX-License-Identifier: GPL-2.0-or-later
|
||||
*/
|
||||
|
@ -26,32 +27,23 @@ namespace Decoration
|
|||
{
|
||||
|
||||
DecorationPalette::DecorationPalette(const QString &colorScheme)
|
||||
: m_colorScheme(QFileInfo(colorScheme).isAbsolute()
|
||||
? colorScheme
|
||||
: QStandardPaths::locate(QStandardPaths::GenericConfigLocation, colorScheme))
|
||||
: m_colorScheme(colorScheme != QStringLiteral("kdeglobals") ? colorScheme : QString() )
|
||||
{
|
||||
if (!m_colorScheme.startsWith(QStandardPaths::writableLocation(QStandardPaths::GenericConfigLocation)) && colorScheme == QStringLiteral("kdeglobals")) {
|
||||
// kdeglobals doesn't exist so create it. This is needed to monitor it using QFileSystemWatcher.
|
||||
auto config = KSharedConfig::openConfig(colorScheme, KConfig::SimpleConfig);
|
||||
KConfigGroup wmConfig(config, QStringLiteral("WM"));
|
||||
wmConfig.writeEntry("FakeEntryToKeepThisGroup", true);
|
||||
config->sync();
|
||||
|
||||
m_colorScheme = QStandardPaths::locate(QStandardPaths::GenericConfigLocation, colorScheme);
|
||||
if (m_colorScheme.isEmpty()) {
|
||||
m_colorSchemeConfig = KSharedConfig::openConfig(m_colorScheme, KConfig::FullConfig);
|
||||
} else {
|
||||
m_colorSchemeConfig = KSharedConfig::openConfig(m_colorScheme, KConfig::SimpleConfig);
|
||||
}
|
||||
m_watcher.addPath(m_colorScheme);
|
||||
connect(&m_watcher, &QFileSystemWatcher::fileChanged, [this]() {
|
||||
m_watcher.addPath(m_colorScheme);
|
||||
update();
|
||||
emit changed();
|
||||
});
|
||||
m_watcher = KConfigWatcher::create(m_colorSchemeConfig);
|
||||
|
||||
connect(m_watcher.data(), &KConfigWatcher::configChanged, this, &DecorationPalette::update);
|
||||
|
||||
update();
|
||||
}
|
||||
|
||||
bool DecorationPalette::isValid() const
|
||||
{
|
||||
return m_activeTitleBarColor.isValid();
|
||||
return true;
|
||||
}
|
||||
|
||||
QColor DecorationPalette::color(KDecoration2::ColorGroup group, KDecoration2::ColorRole role) const
|
||||
|
@ -59,33 +51,69 @@ QColor DecorationPalette::color(KDecoration2::ColorGroup group, KDecoration2::Co
|
|||
using KDecoration2::ColorRole;
|
||||
using KDecoration2::ColorGroup;
|
||||
|
||||
if (m_legacyPalette.has_value()) {
|
||||
switch (role) {
|
||||
case ColorRole::Frame:
|
||||
switch (group) {
|
||||
case ColorGroup::Active:
|
||||
return m_legacyPalette->activeFrameColor;
|
||||
case ColorGroup::Inactive:
|
||||
return m_legacyPalette->inactiveFrameColor;
|
||||
default:
|
||||
return QColor();
|
||||
}
|
||||
case ColorRole::TitleBar:
|
||||
switch (group) {
|
||||
case ColorGroup::Active:
|
||||
return m_legacyPalette->activeTitleBarColor;
|
||||
case ColorGroup::Inactive:
|
||||
return m_legacyPalette->inactiveTitleBarColor;
|
||||
default:
|
||||
return QColor();
|
||||
}
|
||||
case ColorRole::Foreground:
|
||||
switch (group) {
|
||||
case ColorGroup::Active:
|
||||
return m_legacyPalette->activeForegroundColor;
|
||||
case ColorGroup::Inactive:
|
||||
return m_legacyPalette->inactiveForegroundColor;
|
||||
case ColorGroup::Warning:
|
||||
return m_legacyPalette->warningForegroundColor;
|
||||
default:
|
||||
return QColor();
|
||||
}
|
||||
default:
|
||||
return QColor();
|
||||
}
|
||||
}
|
||||
|
||||
switch (role) {
|
||||
case ColorRole::Frame:
|
||||
switch (group) {
|
||||
case ColorGroup::Active:
|
||||
return m_activeFrameColor;
|
||||
return m_palette.active.background().color();
|
||||
case ColorGroup::Inactive:
|
||||
return m_inactiveFrameColor;
|
||||
return m_palette.inactive.background().color();
|
||||
default:
|
||||
return QColor();
|
||||
}
|
||||
case ColorRole::TitleBar:
|
||||
switch (group) {
|
||||
case ColorGroup::Active:
|
||||
return m_activeTitleBarColor;
|
||||
return m_palette.active.background().color();
|
||||
case ColorGroup::Inactive:
|
||||
return m_inactiveTitleBarColor;
|
||||
return m_palette.inactive.background().color();
|
||||
default:
|
||||
return QColor();
|
||||
}
|
||||
case ColorRole::Foreground:
|
||||
switch (group) {
|
||||
case ColorGroup::Active:
|
||||
return m_activeForegroundColor;
|
||||
return m_palette.active.foreground().color();
|
||||
case ColorGroup::Inactive:
|
||||
return m_inactiveForegroundColor;
|
||||
return m_palette.inactive.foreground().color();
|
||||
case ColorGroup::Warning:
|
||||
return m_warningForegroundColor;
|
||||
return m_palette.inactive.foreground(KColorScheme::ForegroundRole::NegativeText).color();
|
||||
default:
|
||||
return QColor();
|
||||
}
|
||||
|
@ -96,31 +124,41 @@ QColor DecorationPalette::color(KDecoration2::ColorGroup group, KDecoration2::Co
|
|||
|
||||
QPalette DecorationPalette::palette() const
|
||||
{
|
||||
return m_palette;
|
||||
return m_legacyPalette ? m_legacyPalette->palette : KColorScheme::createApplicationPalette(m_colorSchemeConfig);
|
||||
}
|
||||
|
||||
void DecorationPalette::update()
|
||||
{
|
||||
auto config = KSharedConfig::openConfig(m_colorScheme, KConfig::SimpleConfig);
|
||||
KConfigGroup wmConfig(config, QStringLiteral("WM"));
|
||||
m_colorSchemeConfig->sync();
|
||||
|
||||
if (!wmConfig.exists() && !m_colorScheme.endsWith(QStringLiteral("/kdeglobals"))) {
|
||||
qCWarning(KWIN_DECORATIONS) << "Invalid color scheme" << m_colorScheme << "lacks WM group";
|
||||
return;
|
||||
if (!KColorScheme::isColorSetSupported(m_colorSchemeConfig, KColorScheme::Header)) {
|
||||
KConfigGroup wmConfig(m_colorSchemeConfig, QStringLiteral("WM"));
|
||||
|
||||
if (!wmConfig.exists()) {
|
||||
m_palette.active = KColorScheme(QPalette::Normal, KColorScheme::Header, m_colorSchemeConfig);
|
||||
m_palette.inactive = KColorScheme(QPalette::Inactive, KColorScheme::Header, m_colorSchemeConfig);
|
||||
m_legacyPalette.reset();
|
||||
return;
|
||||
}
|
||||
|
||||
m_legacyPalette = LegacyPalette{};
|
||||
m_legacyPalette->palette = KColorScheme::createApplicationPalette(m_colorSchemeConfig);
|
||||
m_legacyPalette->activeFrameColor = wmConfig.readEntry("frame", m_legacyPalette->palette.color(QPalette::Active, QPalette::Window));
|
||||
m_legacyPalette->inactiveFrameColor = wmConfig.readEntry("inactiveFrame", m_legacyPalette->activeFrameColor);
|
||||
m_legacyPalette->activeTitleBarColor = wmConfig.readEntry("activeBackground", m_legacyPalette->palette.color(QPalette::Active, QPalette::Highlight));
|
||||
m_legacyPalette->inactiveTitleBarColor = wmConfig.readEntry("inactiveBackground", m_legacyPalette->inactiveTitleBarColor);
|
||||
m_legacyPalette->activeForegroundColor = wmConfig.readEntry("activeForeground", m_legacyPalette->palette.color(QPalette::Active, QPalette::HighlightedText));
|
||||
m_legacyPalette->inactiveForegroundColor = wmConfig.readEntry("inactiveForeground", m_legacyPalette->activeForegroundColor.darker());
|
||||
|
||||
KConfigGroup windowColorsConfig(m_colorSchemeConfig, QStringLiteral("Colors:Window"));
|
||||
m_legacyPalette->warningForegroundColor = windowColorsConfig.readEntry("ForegroundNegative", QColor(237, 21, 2));
|
||||
} else {
|
||||
m_palette.active = KColorScheme(QPalette::Normal, KColorScheme::Header, m_colorSchemeConfig);
|
||||
m_palette.inactive = KColorScheme(QPalette::Inactive, KColorScheme::Header, m_colorSchemeConfig);
|
||||
m_legacyPalette.reset();
|
||||
}
|
||||
|
||||
m_palette = KColorScheme::createApplicationPalette(config);
|
||||
|
||||
m_activeFrameColor = wmConfig.readEntry("frame", m_palette.color(QPalette::Active, QPalette::Window));
|
||||
m_inactiveFrameColor = wmConfig.readEntry("inactiveFrame", m_activeFrameColor);
|
||||
m_activeTitleBarColor = wmConfig.readEntry("activeBackground", m_palette.color(QPalette::Active, QPalette::Highlight));
|
||||
m_inactiveTitleBarColor = wmConfig.readEntry("inactiveBackground", m_inactiveFrameColor);
|
||||
m_activeForegroundColor = wmConfig.readEntry("activeForeground", m_palette.color(QPalette::Active, QPalette::HighlightedText));
|
||||
m_inactiveForegroundColor = wmConfig.readEntry("inactiveForeground", m_activeForegroundColor.darker());
|
||||
|
||||
KConfigGroup windowColorsConfig(config, QStringLiteral("Colors:Window"));
|
||||
m_warningForegroundColor = windowColorsConfig.readEntry("ForegroundNegative", QColor(237, 21, 2));
|
||||
|
||||
Q_EMIT changed();
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -15,6 +15,11 @@
|
|||
#include <KDecoration2/DecorationSettings>
|
||||
#include <QFileSystemWatcher>
|
||||
#include <QPalette>
|
||||
#include <KSharedConfig>
|
||||
#include <KColorScheme>
|
||||
#include <KConfigWatcher>
|
||||
|
||||
#include <optional>
|
||||
|
||||
namespace KWin
|
||||
{
|
||||
|
@ -38,19 +43,31 @@ private:
|
|||
void update();
|
||||
|
||||
QString m_colorScheme;
|
||||
QFileSystemWatcher m_watcher;
|
||||
KConfigWatcher::Ptr m_watcher;
|
||||
|
||||
QPalette m_palette;
|
||||
struct LegacyPalette {
|
||||
QPalette palette;
|
||||
|
||||
QColor m_activeTitleBarColor;
|
||||
QColor m_inactiveTitleBarColor;
|
||||
QColor activeTitleBarColor;
|
||||
QColor inactiveTitleBarColor;
|
||||
|
||||
QColor m_activeFrameColor;
|
||||
QColor m_inactiveFrameColor;
|
||||
QColor activeFrameColor;
|
||||
QColor inactiveFrameColor;
|
||||
|
||||
QColor m_activeForegroundColor;
|
||||
QColor m_inactiveForegroundColor;
|
||||
QColor m_warningForegroundColor;
|
||||
QColor activeForegroundColor;
|
||||
QColor inactiveForegroundColor;
|
||||
QColor warningForegroundColor;
|
||||
};
|
||||
|
||||
struct ModernPalette {
|
||||
KColorScheme active;
|
||||
KColorScheme inactive;
|
||||
};
|
||||
|
||||
std::optional<LegacyPalette> m_legacyPalette;
|
||||
KSharedConfig::Ptr m_colorSchemeConfig;
|
||||
|
||||
ModernPalette m_palette;
|
||||
};
|
||||
|
||||
}
|
||||
|
|
27
effects.cpp
27
effects.cpp
|
@ -237,8 +237,12 @@ EffectsHandlerImpl::EffectsHandlerImpl(Compositor *compositor, Scene *scene)
|
|||
}
|
||||
|
||||
// connect all clients
|
||||
for (X11Client *c : ws->clientList()) {
|
||||
setupClientConnections(c);
|
||||
for (AbstractClient *client : ws->allClientList()) {
|
||||
if (client->readyForPainting()) {
|
||||
setupClientConnections(client);
|
||||
} else {
|
||||
connect(client, &Toplevel::windowShown, this, &EffectsHandlerImpl::slotClientShown);
|
||||
}
|
||||
}
|
||||
for (Unmanaged *u : ws->unmanagedList()) {
|
||||
setupUnmanagedConnections(u);
|
||||
|
@ -246,16 +250,7 @@ EffectsHandlerImpl::EffectsHandlerImpl(Compositor *compositor, Scene *scene)
|
|||
for (InternalClient *client : ws->internalClients()) {
|
||||
setupClientConnections(client);
|
||||
}
|
||||
if (waylandServer()) {
|
||||
const auto clients = waylandServer()->clients();
|
||||
for (AbstractClient *c : clients) {
|
||||
if (c->readyForPainting()) {
|
||||
setupClientConnections(c);
|
||||
} else {
|
||||
connect(c, &Toplevel::windowShown, this, &EffectsHandlerImpl::slotClientShown);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
reconfigure();
|
||||
}
|
||||
|
||||
|
@ -590,7 +585,7 @@ void EffectsHandlerImpl::slotTabRemoved(EffectWindow *w, EffectWindow* leaderOfF
|
|||
emit tabRemoved(w, leaderOfFormerGroup);
|
||||
}
|
||||
|
||||
void EffectsHandlerImpl::slotWindowDamaged(Toplevel* t, const QRect& r)
|
||||
void EffectsHandlerImpl::slotWindowDamaged(Toplevel* t, const QRegion& r)
|
||||
{
|
||||
if (!t->effectWindow()) {
|
||||
// can happen during tear down of window
|
||||
|
@ -2061,11 +2056,11 @@ void EffectWindowImpl::registerThumbnail(AbstractThumbnailItem *item)
|
|||
{
|
||||
if (WindowThumbnailItem *thumb = qobject_cast<WindowThumbnailItem*>(item)) {
|
||||
insertThumbnail(thumb);
|
||||
connect(thumb, SIGNAL(destroyed(QObject*)), SLOT(thumbnailDestroyed(QObject*)));
|
||||
connect(thumb, &QObject::destroyed, this, &EffectWindowImpl::thumbnailDestroyed);
|
||||
connect(thumb, &WindowThumbnailItem::wIdChanged, this, &EffectWindowImpl::thumbnailTargetChanged);
|
||||
} else if (DesktopThumbnailItem *desktopThumb = qobject_cast<DesktopThumbnailItem*>(item)) {
|
||||
m_desktopThumbnails.append(desktopThumb);
|
||||
connect(desktopThumb, SIGNAL(destroyed(QObject*)), SLOT(desktopThumbnailDestroyed(QObject*)));
|
||||
connect(desktopThumb, &QObject::destroyed, this, &EffectWindowImpl::desktopThumbnailDestroyed);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -2182,7 +2177,7 @@ EffectFrameImpl::EffectFrameImpl(EffectFrameStyle style, bool staticSize, QPoint
|
|||
if (m_style == EffectFrameStyled) {
|
||||
m_frame.setImagePath(QStringLiteral("widgets/background"));
|
||||
m_frame.setCacheAllRenderedFrames(true);
|
||||
connect(m_theme, SIGNAL(themeChanged()), this, SLOT(plasmaThemeChanged()));
|
||||
connect(m_theme, &Plasma::Theme::themeChanged, this, &EffectFrameImpl::plasmaThemeChanged);
|
||||
}
|
||||
m_selection.setImagePath(QStringLiteral("widgets/viewitem"));
|
||||
m_selection.setElementPrefix(QStringLiteral("hover"));
|
||||
|
|
|
@ -289,7 +289,7 @@ protected Q_SLOTS:
|
|||
void slotGeometryShapeChanged(KWin::Toplevel *t, const QRect &old);
|
||||
void slotFrameGeometryChanged(Toplevel *toplevel, const QRect &oldGeometry);
|
||||
void slotPaddingChanged(KWin::Toplevel *t, const QRect &old);
|
||||
void slotWindowDamaged(KWin::Toplevel *t, const QRect& r);
|
||||
void slotWindowDamaged(KWin::Toplevel *t, const QRegion& r);
|
||||
|
||||
protected:
|
||||
void connectNotify(const QMetaMethod &signal) override;
|
||||
|
|
|
@ -57,7 +57,7 @@ void CubeSlideEffect::reconfigure(ReconfigureFlags)
|
|||
CubeSlideConfig::self()->read();
|
||||
// TODO: rename rotationDuration to duration
|
||||
rotationDuration = animationTime(CubeSlideConfig::rotationDuration() != 0 ? CubeSlideConfig::rotationDuration() : 500);
|
||||
timeLine.setCurveShape(QTimeLine::EaseInOutCurve);
|
||||
timeLine.setEasingCurve(QEasingCurve::InOutSine);
|
||||
timeLine.setDuration(rotationDuration);
|
||||
dontSlidePanels = CubeSlideConfig::dontSlidePanels();
|
||||
dontSlideStickyWindows = CubeSlideConfig::dontSlideStickyWindows();
|
||||
|
@ -367,9 +367,9 @@ void CubeSlideEffect::postPaintScreen()
|
|||
}
|
||||
timeLine.setCurrentTime(0);
|
||||
if (slideRotations.count() == 1)
|
||||
timeLine.setCurveShape(QTimeLine::EaseOutCurve);
|
||||
timeLine.setEasingCurve(QEasingCurve::OutSine);
|
||||
else
|
||||
timeLine.setCurveShape(QTimeLine::LinearCurve);
|
||||
timeLine.setEasingCurve(QEasingCurve::Linear);
|
||||
if (slideRotations.empty()) {
|
||||
for (EffectWindow* w : staticWindows) {
|
||||
w->setData(WindowForceBlurRole, QVariant());
|
||||
|
@ -500,9 +500,9 @@ void CubeSlideEffect::startAnimation() {
|
|||
}
|
||||
}
|
||||
if (slideRotations.count() == 1) {
|
||||
timeLine.setCurveShape(QTimeLine::EaseInOutCurve);
|
||||
timeLine.setEasingCurve(QEasingCurve::InOutSine);
|
||||
} else {
|
||||
timeLine.setCurveShape(QTimeLine::EaseInCurve);
|
||||
timeLine.setEasingCurve(QEasingCurve::InSine);
|
||||
}
|
||||
effects->setActiveFullScreenEffect(this);
|
||||
timeLine.setCurrentTime(0);
|
||||
|
|
|
@ -108,7 +108,7 @@ void DesktopGridEffect::reconfigure(ReconfigureFlags)
|
|||
|
||||
// TODO: rename zoomDuration to duration
|
||||
zoomDuration = animationTime(DesktopGridConfig::zoomDuration() != 0 ? DesktopGridConfig::zoomDuration() : 300);
|
||||
timeline.setCurveShape(QTimeLine::EaseInOutCurve);
|
||||
timeline.setEasingCurve(QEasingCurve::InOutSine);
|
||||
timeline.setDuration(zoomDuration);
|
||||
|
||||
border = DesktopGridConfig::borderWidth();
|
||||
|
@ -1046,7 +1046,7 @@ void DesktopGridEffect::setup()
|
|||
hoverTimeline.clear();
|
||||
for (int i = 0; i < effects->numberOfDesktops(); i++) {
|
||||
QTimeLine *newTimeline = new QTimeLine(zoomDuration, this);
|
||||
newTimeline->setCurveShape(QTimeLine::EaseInOutCurve);
|
||||
newTimeline->setEasingCurve(QEasingCurve::InOutSine);
|
||||
hoverTimeline.append(newTimeline);
|
||||
}
|
||||
hoverTimeline[effects->currentDesktop() - 1]->setCurrentTime(hoverTimeline[effects->currentDesktop() - 1]->duration());
|
||||
|
@ -1282,7 +1282,7 @@ void DesktopGridEffect::desktopsAdded(int old)
|
|||
for (int i = old; i <= effects->numberOfDesktops(); i++) {
|
||||
// add a timeline for the new desktop
|
||||
QTimeLine *newTimeline = new QTimeLine(zoomDuration, this);
|
||||
newTimeline->setCurveShape(QTimeLine::EaseInOutCurve);
|
||||
newTimeline->setEasingCurve(QEasingCurve::InOutSine);
|
||||
hoverTimeline.append(newTimeline);
|
||||
}
|
||||
|
||||
|
|
|
@ -85,8 +85,8 @@ DesktopGridEffectConfig::DesktopGridEffectConfig(QWidget* parent, const QVariant
|
|||
|
||||
DesktopGridEffectConfig::~DesktopGridEffectConfig()
|
||||
{
|
||||
// If save() is called undoChanges() has no effect
|
||||
m_ui->shortcutEditor->undoChanges();
|
||||
// If save() is called undo() has no effect
|
||||
m_ui->shortcutEditor->undo();
|
||||
}
|
||||
|
||||
void DesktopGridEffectConfig::save()
|
||||
|
|
|
@ -18,6 +18,7 @@ Name[nl]=Oog op scherm
|
|||
Name[nn]=Auge på skjerm
|
||||
Name[pt]=Olho no Ecrã
|
||||
Name[pt_BR]=Olho na tela
|
||||
Name[ro]=Ochi pe ecran
|
||||
Name[ru]=Втягивание окон в центр экрана
|
||||
Name[sk]=Oko na obrazovke
|
||||
Name[sl]=Oko na zaslonu
|
||||
|
@ -45,6 +46,7 @@ Comment[nl]=Zuig vensters in het bureaublad
|
|||
Comment[nn]=Sug vindauge inn i skrivebordet
|
||||
Comment[pt]=Aspira as janelas para o ecrã
|
||||
Comment[pt_BR]=Suga as janelas para a área de trabalho
|
||||
Comment[ro]=Suge ferestrele în birou
|
||||
Comment[ru]=Втягивание окон в центр рабочего стола
|
||||
Comment[sk]=Nasať okná na plochu
|
||||
Comment[sl]=Prisesa okna na namizje
|
||||
|
|
|
@ -54,7 +54,7 @@ Name[pa]=ਫਿੱਕਾ
|
|||
Name[pl]=Zanikanie/wyłanianie
|
||||
Name[pt]=Desvanecer
|
||||
Name[pt_BR]=Desvanecer
|
||||
Name[ro]=Decolorare
|
||||
Name[ro]=Estompare
|
||||
Name[ru]=Растворение
|
||||
Name[se]=Rievdat šearratvuođa
|
||||
Name[si]=විවර්ණ
|
||||
|
@ -127,7 +127,7 @@ Comment[pa]=ਜਦੋਂ ਵਿੰਡੋਜ਼ ਨੂੰ ਵੇਖਾਉਣਾ
|
|||
Comment[pl]=Okna gładko wyłaniają się przy otwieraniu i zanikają przy zamykaniu
|
||||
Comment[pt]=Fazer com que as janelas apareçam/desapareçam suavemente quando aparecem ou ficam escondidas
|
||||
Comment[pt_BR]=Faz as janelas aparecerem/desaparecerem suavemente quando são exibidas ou ocultadas
|
||||
Comment[ro]=Face ferestrele să se (de)coloreze când sunt afișate sau ascunse
|
||||
Comment[ro]=Face ferestrele să se (de)coloreze când sunt arătate sau ascunse
|
||||
Comment[ru]=Закрывающиеся окна будут становиться всё более прозрачными, а потом совсем исчезать
|
||||
Comment[si]=පෙන්වන හා සඟවන විට කවුළු විවර්ණය කිරීම හා නොකිරීම සිදු කරන්න
|
||||
Comment[sk]=Okná sa plynule objavia/zmiznú pri ich zobrazení alebo skrytí
|
||||
|
|
|
@ -112,7 +112,7 @@ Comment[pa]=ਜਦੋਂ ਵੁਰਚੁਅਲ ਡੈਸਕਟਾਪ ਵਿੱ
|
|||
Comment[pl]=Przenika pulpity wirtualne przy ich przełączaniu
|
||||
Comment[pt]=Desvanece entre os ecrãs virtuais, ao circular entre eles
|
||||
Comment[pt_BR]=Desaparece entre as áreas de trabalho virtuais, ao alternar entre elas
|
||||
Comment[ro]=Estompare între birourile virtuale la comutarea între ele
|
||||
Comment[ro]=Estompare între birourile virtuale la schimbarea între ele
|
||||
Comment[ru]=Постепенная смена изображения при переключении на другой рабочий стол
|
||||
Comment[si]=අතත්ය වැඩතල අතර මාරුවීමේදී ඒවා අතර විවර්ණය කරන්න
|
||||
Comment[sk]=Efekt zoslabenia pri prepínaní virtuálnych plôch
|
||||
|
|
|
@ -24,6 +24,7 @@ Name[nn]=Inn- og uttoning av sprettoppvindauge
|
|||
Name[pl]=Zanikanie okien wysuwnych
|
||||
Name[pt]=Mensagens Desvanecentes
|
||||
Name[pt_BR]=Desvanecer mensagens
|
||||
Name[ro]=Indicii estompate
|
||||
Name[ru]=Растворяющиеся всплывающие окна
|
||||
Name[sk]=Miznúce vyskakovacie okná
|
||||
Name[sl]=Prehajajoča pojavna okna
|
||||
|
@ -58,6 +59,7 @@ Comment[nn]=Ton sprettoppvindauge gradvis inn og ut når dei vert viste eller g
|
|||
Comment[pl]=Okna wysuwne gładko wyłaniają się przy otwieraniu i zanikają przy zamykaniu
|
||||
Comment[pt]=Fazer com que as janelas apareçam/desapareçam suavemente quando aparecem ou ficam escondidas
|
||||
Comment[pt_BR]=Faz as mensagens aparecerem/desaparecerem suavemente quando são exibidas ou ocultadas
|
||||
Comment[ro]=Face indiciile să se (de)coloreze când sunt arătate sau ascunse
|
||||
Comment[ru]=Всплывающие окна при закрытии будут становиться всё более прозрачными, а потом совсем исчезать
|
||||
Comment[sk]=Okná sa plynule objavia/zmiznú pri ich zobrazení alebo skrytí
|
||||
Comment[sl]=Okna se pojavijo in izginejo postopoma, kadar se pokažejo ali skrijejo
|
||||
|
|
|
@ -28,7 +28,7 @@ namespace KWin
|
|||
|
||||
FlipSwitchEffect::FlipSwitchEffect()
|
||||
: m_selectedWindow(nullptr)
|
||||
, m_currentAnimationShape(QTimeLine::EaseInOutCurve)
|
||||
, m_currentAnimationEasingCurve(QEasingCurve::InOutSine)
|
||||
, m_active(false)
|
||||
, m_start(false)
|
||||
, m_stop(false)
|
||||
|
@ -307,11 +307,11 @@ void FlipSwitchEffect::postPaintScreen()
|
|||
m_animation = true;
|
||||
m_timeLine.setCurrentTime(0);
|
||||
if (m_scheduledDirections.count() == 1) {
|
||||
m_currentAnimationShape = QTimeLine::EaseOutCurve;
|
||||
m_timeLine.setCurveShape(m_currentAnimationShape);
|
||||
m_currentAnimationEasingCurve = QEasingCurve::OutSine;
|
||||
m_timeLine.setEasingCurve(m_currentAnimationEasingCurve);
|
||||
} else {
|
||||
m_currentAnimationShape = QTimeLine::LinearCurve;
|
||||
m_timeLine.setCurveShape(m_currentAnimationShape);
|
||||
m_currentAnimationEasingCurve = QEasingCurve::Linear;
|
||||
m_timeLine.setEasingCurve(m_currentAnimationEasingCurve);
|
||||
}
|
||||
}
|
||||
effects->addRepaintFull();
|
||||
|
@ -334,13 +334,13 @@ void FlipSwitchEffect::postPaintScreen()
|
|||
} else {
|
||||
if (m_scheduledDirections.count() == 1) {
|
||||
if (m_stop)
|
||||
m_currentAnimationShape = QTimeLine::LinearCurve;
|
||||
m_currentAnimationEasingCurve = QEasingCurve::Linear;
|
||||
else
|
||||
m_currentAnimationShape = QTimeLine::EaseOutCurve;
|
||||
m_currentAnimationEasingCurve = QEasingCurve::OutSine;
|
||||
} else {
|
||||
m_currentAnimationShape = QTimeLine::LinearCurve;
|
||||
m_currentAnimationEasingCurve = QEasingCurve::Linear;
|
||||
}
|
||||
m_timeLine.setCurveShape(m_currentAnimationShape);
|
||||
m_timeLine.setEasingCurve(m_currentAnimationEasingCurve);
|
||||
}
|
||||
}
|
||||
if (m_start || m_stop || m_animation)
|
||||
|
@ -515,7 +515,7 @@ void FlipSwitchEffect::setActive(bool activate, FlipSwitchMode mode)
|
|||
effects->setActiveFullScreenEffect(this);
|
||||
m_active = true;
|
||||
m_start = true;
|
||||
m_startStopTimeLine.setCurveShape(QTimeLine::EaseInOutCurve);
|
||||
m_startStopTimeLine.setEasingCurve(QEasingCurve::InOutSine);
|
||||
m_activeScreen = effects->activeScreen();
|
||||
m_screenArea = effects->clientArea(ScreenArea, m_activeScreen, effects->currentDesktop());
|
||||
|
||||
|
@ -623,16 +623,16 @@ void FlipSwitchEffect::setActive(bool activate, FlipSwitchMode mode)
|
|||
}
|
||||
m_stop = true;
|
||||
if (m_animation) {
|
||||
m_startStopTimeLine.setCurveShape(QTimeLine::EaseOutCurve);
|
||||
m_startStopTimeLine.setEasingCurve(QEasingCurve::OutSine);
|
||||
if (m_scheduledDirections.count() == 1) {
|
||||
if (m_currentAnimationShape == QTimeLine::EaseInOutCurve)
|
||||
m_currentAnimationShape = QTimeLine::EaseInCurve;
|
||||
else if (m_currentAnimationShape == QTimeLine::EaseOutCurve)
|
||||
m_currentAnimationShape = QTimeLine::LinearCurve;
|
||||
m_timeLine.setCurveShape(m_currentAnimationShape);
|
||||
if (m_currentAnimationEasingCurve == QEasingCurve::InOutSine)
|
||||
m_currentAnimationEasingCurve = QEasingCurve::InSine;
|
||||
else if (m_currentAnimationEasingCurve == QEasingCurve::OutSine)
|
||||
m_currentAnimationEasingCurve = QEasingCurve::Linear;
|
||||
m_timeLine.setEasingCurve(m_currentAnimationEasingCurve);
|
||||
}
|
||||
} else
|
||||
m_startStopTimeLine.setCurveShape(QTimeLine::EaseInOutCurve);
|
||||
m_startStopTimeLine.setEasingCurve(QEasingCurve::InOutSine);
|
||||
effects->stopMouseInterception(this);
|
||||
if (m_hasKeyboardGrab) {
|
||||
effects->ungrabKeyboard();
|
||||
|
@ -703,15 +703,15 @@ void FlipSwitchEffect::scheduleAnimation(const SwitchingDirection& direction, in
|
|||
{
|
||||
if (m_start) {
|
||||
// start is still active so change the shape to have a nice transition
|
||||
m_startStopTimeLine.setCurveShape(QTimeLine::EaseInCurve);
|
||||
m_startStopTimeLine.setEasingCurve(QEasingCurve::InSine);
|
||||
}
|
||||
if (!m_animation && !m_start) {
|
||||
m_animation = true;
|
||||
m_scheduledDirections.enqueue(direction);
|
||||
distance--;
|
||||
// reset shape just to make sure
|
||||
m_currentAnimationShape = QTimeLine::EaseInOutCurve;
|
||||
m_timeLine.setCurveShape(m_currentAnimationShape);
|
||||
m_currentAnimationEasingCurve = QEasingCurve::InOutSine;
|
||||
m_timeLine.setEasingCurve(m_currentAnimationEasingCurve);
|
||||
}
|
||||
for (int i = 0; i < distance; i++) {
|
||||
if (m_scheduledDirections.count() > 1 && m_scheduledDirections.last() != direction)
|
||||
|
@ -725,20 +725,20 @@ void FlipSwitchEffect::scheduleAnimation(const SwitchingDirection& direction, in
|
|||
}
|
||||
}
|
||||
if (m_scheduledDirections.count() > 1) {
|
||||
QTimeLine::CurveShape newShape = QTimeLine::EaseInOutCurve;
|
||||
switch(m_currentAnimationShape) {
|
||||
case QTimeLine::EaseInOutCurve:
|
||||
newShape = QTimeLine::EaseInCurve;
|
||||
QEasingCurve curve;
|
||||
switch (m_currentAnimationEasingCurve.type()) {
|
||||
case QEasingCurve::InOutSine:
|
||||
curve = QEasingCurve::InSine;
|
||||
break;
|
||||
case QTimeLine::EaseOutCurve:
|
||||
newShape = QTimeLine::LinearCurve;
|
||||
case QEasingCurve::OutSine:
|
||||
curve = QEasingCurve::Linear;
|
||||
break;
|
||||
default:
|
||||
newShape = m_currentAnimationShape;
|
||||
curve = m_currentAnimationEasingCurve;
|
||||
}
|
||||
if (newShape != m_currentAnimationShape) {
|
||||
m_currentAnimationShape = newShape;
|
||||
m_timeLine.setCurveShape(m_currentAnimationShape);
|
||||
if (m_currentAnimationEasingCurve != curve) {
|
||||
m_currentAnimationEasingCurve = curve;
|
||||
m_timeLine.setEasingCurve(curve);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -111,7 +111,7 @@ private:
|
|||
EffectWindow* m_selectedWindow;
|
||||
QTimeLine m_timeLine;
|
||||
QTimeLine m_startStopTimeLine;
|
||||
QTimeLine::CurveShape m_currentAnimationShape;
|
||||
QEasingCurve m_currentAnimationEasingCurve;
|
||||
QRect m_screenArea;
|
||||
int m_activeScreen;
|
||||
bool m_active;
|
||||
|
|
|
@ -54,7 +54,7 @@ Name[pa]=ਫਲਿੱਪ ਸਵਿੱਚ
|
|||
Name[pl]=Przełączanie przebierane
|
||||
Name[pt]=Mudança em Pilha
|
||||
Name[pt_BR]=Mudança em pilha
|
||||
Name[ro]=Comutare cu întoarcere
|
||||
Name[ro]=Schimbare cu întoarcere
|
||||
Name[ru]=Перелистывание
|
||||
Name[si]=උඩට ගැනීම් මාරුව
|
||||
Name[sk]=Prepínať v kartotéke
|
||||
|
|
|
@ -25,6 +25,7 @@ Name[nn]=Fjern fargemetting på ikkje-responsive program
|
|||
Name[pl]=Odbarwienie nieodpowiadających aplikacji
|
||||
Name[pt]=Reduzir a Saturação das Aplicações Bloqueadas
|
||||
Name[pt_BR]=Reduzir saturação de aplicativos que não respondem
|
||||
Name[ro]=Desaturează aplicațiile ce nu răspund
|
||||
Name[ru]=Обесцвечивание зависших приложений
|
||||
Name[sk]=Desaturovať neodpovedajúce aplikácie
|
||||
Name[sl]=Zmanjšaj nasičenost neodzivnih programov
|
||||
|
@ -65,6 +66,7 @@ Comment[nn]=Fjern fargemetting på vindauge på program som ikkje lenger reagere
|
|||
Comment[pl]=Odbarwia okna nieodpowiadających (zawieszonych) aplikacji
|
||||
Comment[pt]=Reduzir a saturação das janelas das aplicações sem resposta (bloqueadas)
|
||||
Comment[pt_BR]=Reduzir saturação de janelas de aplicativos que não respondem (travados)
|
||||
Comment[ro]=Desaturează ferestrele aplicațiilor ce nu răspund (înghețate)
|
||||
Comment[ru]=Обесцвечивание окон приложений, не отвечающих на запросы
|
||||
Comment[sk]=Desaturovať okná neodpovedajúcich aplikácií
|
||||
Comment[sl]=Zmanjšaj nasičenost oken neodzivnih (zamrznjenih) programov
|
||||
|
|
|
@ -1,11 +1,17 @@
|
|||
[Desktop Entry]
|
||||
Comment=Animation for a window going to and leaving full screen mode
|
||||
Comment[ca]=Animació per a una finestra que entra o abandona el mode de pantalla completa
|
||||
Comment[en_GB]=Animation for a window going to and leaving full screen mode
|
||||
Comment[es]=Animación para una ventana que entra en el modo de pantalla completa o sale de él
|
||||
Comment[eu]=Pantaila-osoko modutik/modura aldatzen den leiho baten animazioa
|
||||
Comment[fr]=Animation pour une fenêtre basculant vers ou sortant du mode « Plein écran »
|
||||
Comment[it]=Animazione per una finestra che entra e esce dalla modalità a schermo intero
|
||||
Comment[ko]=창이 전체 화면 모드로 진입하거나 벗어날 때 사용할 애니메이션
|
||||
Comment[nl]=Animatie voor een venster dat gaat naar volledig scherm en deze verlaat
|
||||
Comment[nn]=Animasjon for vindauge som går til eller frå fullskjermsmodus
|
||||
Comment[pt]=Animação para uma janela que vai entrar/sair do modo de ecrã completo
|
||||
Comment[pt_BR]=Animação para uma janela indo e saindo do modo de tela cheia
|
||||
Comment[ro]=Animație pentru o fereastră ce intră sau iese din regim de ecran complet
|
||||
Comment[sk]=Animácia pre okno smerujúce do a opúšťajúce režim celej obrazovky
|
||||
Comment[sl]=Animacija za razpenjanje ali zapuščanje čez zaslon razpetega okna
|
||||
Comment[sv]=Animering för ett fönster till och från fullskärmsläge
|
||||
|
@ -14,12 +20,20 @@ Comment[x-test]=xxAnimation for a window going to and leaving full screen modexx
|
|||
Icon=preferences-system-windows-effect-fullscreen
|
||||
Name=Full Screen
|
||||
Name[ca]=Pantalla completa
|
||||
Name[cs]=Celá obrazovka
|
||||
Name[de]=Vollbild
|
||||
Name[en_GB]=Full Screen
|
||||
Name[es]=Pantalla completa
|
||||
Name[eu]=Pantaila-betea
|
||||
Name[fr]=Plein écran
|
||||
Name[ia]=Schermo plen
|
||||
Name[it]=Schermo intero
|
||||
Name[ko]=전체 화면
|
||||
Name[nl]=Volledig scherm
|
||||
Name[nn]=Fullskjerm
|
||||
Name[pt]=Ecrã Completo
|
||||
Name[pt_BR]=Tela inteira
|
||||
Name[ro]=Ecran complet
|
||||
Name[sk]=Celá obrazovka
|
||||
Name[sl]=Celotni zaslon
|
||||
Name[sv]=Fullskärm
|
||||
|
|
|
@ -60,7 +60,7 @@ InvertEffectConfig::InvertEffectConfig(QWidget* parent, const QVariantList& args
|
|||
InvertEffectConfig::~InvertEffectConfig()
|
||||
{
|
||||
// Undo (only) unsaved changes to global key shortcuts
|
||||
mShortcutEditor->undoChanges();
|
||||
mShortcutEditor->undo();
|
||||
}
|
||||
|
||||
void InvertEffectConfig::load()
|
||||
|
|
|
@ -26,6 +26,7 @@ Name[nn]=Logg ut
|
|||
Name[pl]=Wylogowywanie
|
||||
Name[pt]=Encerrar
|
||||
Name[pt_BR]=Encerrar sessão
|
||||
Name[ro]=Ieșire din sistem
|
||||
Name[ru]=Завершение работы
|
||||
Name[sk]=Odhlásiť sa
|
||||
Name[sl]=Odjava
|
||||
|
@ -61,6 +62,7 @@ Comment[nn]=Ton ut til utloggingsbiletet
|
|||
Comment[pl]=Płynne zanikanie do ekranu wylogowywania
|
||||
Comment[pt]=Desvanecer suavemente para o ecrã de encerramento
|
||||
Comment[pt_BR]=Suaviza o desaparecimento para a tela de encerramento da sessão
|
||||
Comment[ro]=Estompează lin spre ecranul de ieșire
|
||||
Comment[ru]=Плавное появление экрана завершения работы
|
||||
Comment[sk]=Plynule zobrazí plochu pri odhlásení
|
||||
Comment[sl]=Postopoma okno zbledi v zaslon za odjavo
|
||||
|
|
|
@ -81,7 +81,7 @@ LookingGlassEffectConfig::LookingGlassEffectConfig(QWidget* parent, const QVaria
|
|||
LookingGlassEffectConfig::~LookingGlassEffectConfig()
|
||||
{
|
||||
// Undo (only) unsaved changes to global key shortcuts
|
||||
m_ui->editor->undoChanges();
|
||||
m_ui->editor->undo();
|
||||
}
|
||||
|
||||
void LookingGlassEffectConfig::save()
|
||||
|
|
|
@ -59,7 +59,7 @@ Name[pa]=ਸ਼ੀਸ਼ਾ ਵੇਖਣਾ
|
|||
Name[pl]=Lupa
|
||||
Name[pt]=Aparência de Vidro
|
||||
Name[pt_BR]=Espelho
|
||||
Name[ro]=Binoclu
|
||||
Name[ro]=Lentilă
|
||||
Name[ru]=Линза
|
||||
Name[se]=Stuoridanláse
|
||||
Name[si]=වීදුරු ලෙස පෙනෙන
|
||||
|
|
|
@ -41,17 +41,17 @@ MagnifierEffect::MagnifierEffect()
|
|||
{
|
||||
initConfig<MagnifierConfig>();
|
||||
QAction* a;
|
||||
a = KStandardAction::zoomIn(this, SLOT(zoomIn()), this);
|
||||
a = KStandardAction::zoomIn(this, &MagnifierEffect::zoomIn, this);
|
||||
KGlobalAccel::self()->setDefaultShortcut(a, QList<QKeySequence>() << Qt::META + Qt::Key_Equal);
|
||||
KGlobalAccel::self()->setShortcut(a, QList<QKeySequence>() << Qt::META + Qt::Key_Equal);
|
||||
effects->registerGlobalShortcut(Qt::META + Qt::Key_Equal, a);
|
||||
|
||||
a = KStandardAction::zoomOut(this, SLOT(zoomOut()), this);
|
||||
a = KStandardAction::zoomOut(this, &MagnifierEffect::zoomOut, this);
|
||||
KGlobalAccel::self()->setDefaultShortcut(a, QList<QKeySequence>() << Qt::META + Qt::Key_Minus);
|
||||
KGlobalAccel::self()->setShortcut(a, QList<QKeySequence>() << Qt::META + Qt::Key_Minus);
|
||||
effects->registerGlobalShortcut(Qt::META + Qt::Key_Minus, a);
|
||||
|
||||
a = KStandardAction::actualSize(this, SLOT(toggle()), this);
|
||||
a = KStandardAction::actualSize(this, &MagnifierEffect::toggle, this);
|
||||
KGlobalAccel::self()->setDefaultShortcut(a, QList<QKeySequence>() << Qt::META + Qt::Key_0);
|
||||
KGlobalAccel::self()->setShortcut(a, QList<QKeySequence>() << Qt::META + Qt::Key_0);
|
||||
effects->registerGlobalShortcut(Qt::META + Qt::Key_0, a);
|
||||
|
|
|
@ -83,7 +83,7 @@ MagnifierEffectConfig::MagnifierEffectConfig(QWidget* parent, const QVariantList
|
|||
MagnifierEffectConfig::~MagnifierEffectConfig()
|
||||
{
|
||||
// Undo (only) unsaved changes to global key shortcuts
|
||||
m_ui->editor->undoChanges();
|
||||
m_ui->editor->undo();
|
||||
}
|
||||
|
||||
void MagnifierEffectConfig::save()
|
||||
|
|
|
@ -64,6 +64,7 @@ Name[nn]=Formendring for sprettoppvindauge
|
|||
Name[pl]=Zmiennokształtne elementy pomocnicze
|
||||
Name[pt]=Mensagens com mudança de forma
|
||||
Name[pt_BR]=Mensagens com mudança de forma
|
||||
Name[ro]=Indicii în schimbare
|
||||
Name[ru]=Анимация преобразования всплывающих окон
|
||||
Name[sk]=Vysúvať vyskakovacie okná
|
||||
Name[sl]=Prehajajoča pojavna okna
|
||||
|
|
|
@ -65,7 +65,7 @@ MouseClickEffectConfig::MouseClickEffectConfig(QWidget* parent, const QVariantLi
|
|||
MouseClickEffectConfig::~MouseClickEffectConfig()
|
||||
{
|
||||
// Undo (only) unsaved changes to global key shortcuts
|
||||
m_ui->editor->undoChanges();
|
||||
m_ui->editor->undo();
|
||||
}
|
||||
|
||||
void MouseClickEffectConfig::save()
|
||||
|
|
|
@ -75,7 +75,7 @@ MouseMarkEffectConfig::MouseMarkEffectConfig(QWidget* parent, const QVariantList
|
|||
MouseMarkEffectConfig::~MouseMarkEffectConfig()
|
||||
{
|
||||
// Undo (only) unsaved changes to global key shortcuts
|
||||
m_ui->editor->undoChanges();
|
||||
m_ui->editor->undo();
|
||||
}
|
||||
|
||||
void MouseMarkEffectConfig::save()
|
||||
|
|
|
@ -82,8 +82,8 @@ PresentWindowsEffectConfig::PresentWindowsEffectConfig(QWidget* parent, const QV
|
|||
|
||||
PresentWindowsEffectConfig::~PresentWindowsEffectConfig()
|
||||
{
|
||||
// If save() is called undoChanges() has no effect
|
||||
m_ui->shortcutEditor->undoChanges();
|
||||
// If save() is called undo() has no effect
|
||||
m_ui->shortcutEditor->undo();
|
||||
}
|
||||
|
||||
void PresentWindowsEffectConfig::save()
|
||||
|
|
|
@ -25,6 +25,7 @@ Name[nn]=Skalering
|
|||
Name[pl]=Skalowanie
|
||||
Name[pt]=Escala
|
||||
Name[pt_BR]=Escala
|
||||
Name[ro]=Scalare
|
||||
Name[ru]=Масштабирование
|
||||
Name[sk]=Škálovať
|
||||
Name[sl]=Merilo
|
||||
|
@ -58,6 +59,7 @@ Comment[nn]=Skaler vindauge jamt inn og ut når dei vert viste eller gøymde
|
|||
Comment[pl]=Okna gładko pomniejszają się przy otwieraniu i powiększają przy zamykaniu
|
||||
Comment[pt]=Fazer com que as janelas apareçam/desapareçam suavemente quando aparecem ou ficam escondidas
|
||||
Comment[pt_BR]=Faz com que as janelas aumentem ou reduzam o seu tamanho de forma suave ao serem exibidas ou ocultadas
|
||||
Comment[ro]=Face ferestrele să se scaleze lin când sunt arătate sau ascunse
|
||||
Comment[ru]=Плавное увеличение или уменьшение окон при их появлении и скрытии
|
||||
Comment[sk]=Okná sa plynule objavia/zmiznú pri ich zobrazení alebo skrytí
|
||||
Comment[sl]=Okna se pojavijo in izginejo postopoma kadar se prikažejo ali skrijejo
|
||||
|
|
|
@ -23,6 +23,8 @@
|
|||
#include <QMatrix4x4>
|
||||
#include <xcb/xcb_image.h>
|
||||
#include <QPoint>
|
||||
#include <QGuiApplication>
|
||||
#include <QScreen>
|
||||
|
||||
#include <KLocalizedString>
|
||||
#include <KNotification>
|
||||
|
@ -30,6 +32,8 @@
|
|||
#include <unistd.h>
|
||||
#include "../service_utils.h"
|
||||
|
||||
Q_DECLARE_METATYPE(QStringList)
|
||||
|
||||
class ComparableQPoint : public QPoint
|
||||
{
|
||||
public:
|
||||
|
@ -66,6 +70,8 @@ const static QString s_errorInvalidAreaMsg = QStringLiteral("Invalid area reques
|
|||
const static QString s_errorInvalidScreen = QStringLiteral("org.kde.kwin.Screenshot.Error.InvalidScreen");
|
||||
const static QString s_errorInvalidScreenMsg = QStringLiteral("Invalid screen requested");
|
||||
const static QString s_dbusInterfaceName = QStringLiteral("org.kde.kwin.Screenshot");
|
||||
const static QString s_errorScreenMissing = QStringLiteral("org.kde.kwin.Screenshot.Error.ScreenMissing");
|
||||
const static QString s_errorScreenMissingMsg = QStringLiteral("Screen not found");
|
||||
|
||||
bool ScreenShotEffect::supported()
|
||||
{
|
||||
|
@ -355,39 +361,43 @@ void ScreenShotEffect::postPaintScreen()
|
|||
m_multipleOutputsRendered = m_multipleOutputsRendered.united(intersection);
|
||||
if (m_multipleOutputsRendered.boundingRect() == m_scheduledGeometry) {
|
||||
|
||||
// Recompute coordinates
|
||||
if (m_nativeSize) {
|
||||
computeCoordinatesAfterScaling();
|
||||
if (m_orderImg.isEmpty()) {
|
||||
// Recompute coordinates
|
||||
if (m_nativeSize) {
|
||||
computeCoordinatesAfterScaling();
|
||||
}
|
||||
|
||||
// find the output image size
|
||||
int width = 0;
|
||||
int height = 0;
|
||||
QMap<ComparableQPoint, QImage>::const_iterator i;
|
||||
for (i = m_cacheOutputsImages.constBegin(); i != m_cacheOutputsImages.constEnd(); ++i) {
|
||||
const auto pos = i.key();
|
||||
const auto img = i.value();
|
||||
|
||||
width = qMax(width, pos.x() + img.width());
|
||||
height = qMax(height, pos.y() + img.height());
|
||||
}
|
||||
|
||||
QImage multipleOutputsImage = QImage(width, height, QImage::Format_ARGB32);
|
||||
|
||||
QPainter p;
|
||||
p.begin(&multipleOutputsImage);
|
||||
|
||||
// reassemble images together
|
||||
for (i = m_cacheOutputsImages.constBegin(); i != m_cacheOutputsImages.constEnd(); ++i) {
|
||||
auto pos = i.key();
|
||||
auto img = i.value();
|
||||
// disable dpr rendering, we already took care of this
|
||||
img.setDevicePixelRatio(1.0);
|
||||
p.drawImage(pos, img);
|
||||
}
|
||||
p.end();
|
||||
|
||||
sendReplyImage(multipleOutputsImage);
|
||||
} else {
|
||||
sendReplyImages();
|
||||
}
|
||||
|
||||
// find the output image size
|
||||
int width = 0;
|
||||
int height = 0;
|
||||
QMap<ComparableQPoint, QImage>::const_iterator i;
|
||||
for (i = m_cacheOutputsImages.constBegin(); i != m_cacheOutputsImages.constEnd(); ++i) {
|
||||
const auto pos = i.key();
|
||||
const auto img = i.value();
|
||||
|
||||
width = qMax(width, pos.x() + img.width());
|
||||
height = qMax(height, pos.y() + img.height());
|
||||
}
|
||||
|
||||
QImage multipleOutputsImage = QImage(width, height, QImage::Format_ARGB32);
|
||||
|
||||
QPainter p;
|
||||
p.begin(&multipleOutputsImage);
|
||||
|
||||
// reassemble images together
|
||||
for (i = m_cacheOutputsImages.constBegin(); i != m_cacheOutputsImages.constEnd(); ++i) {
|
||||
auto pos = i.key();
|
||||
auto img = i.value();
|
||||
// disable dpr rendering, we already took care of this
|
||||
img.setDevicePixelRatio(1.0);
|
||||
p.drawImage(pos, img);
|
||||
}
|
||||
p.end();
|
||||
|
||||
sendReplyImage(multipleOutputsImage);
|
||||
}
|
||||
|
||||
} else {
|
||||
|
@ -411,10 +421,41 @@ void ScreenShotEffect::sendReplyImage(const QImage &img)
|
|||
close(fd);
|
||||
}
|
||||
}, m_fd, img);
|
||||
m_fd = -1;
|
||||
} else {
|
||||
QDBusConnection::sessionBus().send(m_replyMessage.createReply(saveTempImage(img)));
|
||||
}
|
||||
|
||||
clearState();
|
||||
}
|
||||
|
||||
void ScreenShotEffect::sendReplyImages()
|
||||
{
|
||||
QList<QImage> outputImages;
|
||||
for (const QPoint &pos : qAsConst(m_orderImg)) {
|
||||
auto it = m_cacheOutputsImages.constFind(pos);
|
||||
if (it != m_cacheOutputsImages.constEnd()) {
|
||||
outputImages.append(*it);
|
||||
}
|
||||
}
|
||||
QtConcurrent::run(
|
||||
[] (int fd, const QList<QImage> &outputImages) {
|
||||
QFile file;
|
||||
if (file.open(fd, QIODevice::WriteOnly, QFileDevice::AutoCloseHandle)) {
|
||||
QDataStream ds(&file);
|
||||
ds.setVersion(QDataStream::Qt_DefaultCompiledVersion);
|
||||
ds << outputImages;
|
||||
file.close();
|
||||
} else {
|
||||
close(fd);
|
||||
}
|
||||
}, m_fd, outputImages);
|
||||
|
||||
clearState();
|
||||
}
|
||||
|
||||
void ScreenShotEffect::clearState()
|
||||
{
|
||||
m_fd = -1;
|
||||
m_scheduledGeometry = QRect();
|
||||
m_multipleOutputsRendered = QRegion();
|
||||
m_captureCursor = false;
|
||||
|
@ -422,6 +463,7 @@ void ScreenShotEffect::sendReplyImage(const QImage &img)
|
|||
m_cacheOutputsImages.clear();
|
||||
m_cachedOutputGeometry = QRect();
|
||||
m_nativeSize = false;
|
||||
m_orderImg.clear();
|
||||
}
|
||||
|
||||
QString ScreenShotEffect::saveTempImage(const QImage &img)
|
||||
|
@ -661,6 +703,48 @@ void ScreenShotEffect::screenshotScreen(QDBusUnixFileDescriptor fd, bool capture
|
|||
);
|
||||
}
|
||||
|
||||
void ScreenShotEffect::screenshotScreens(QDBusUnixFileDescriptor fd, const QStringList &screensNames, bool captureCursor, bool shouldReturnNativeSize)
|
||||
{
|
||||
if (!checkCall()) {
|
||||
return;
|
||||
}
|
||||
m_fd = dup(fd.fileDescriptor());
|
||||
if (m_fd == -1) {
|
||||
sendErrorReply(s_errorFd, s_errorFdMsg);
|
||||
return;
|
||||
}
|
||||
m_captureCursor = captureCursor;
|
||||
m_nativeSize = shouldReturnNativeSize;
|
||||
m_orderImg = QList<QPoint>();
|
||||
m_scheduledGeometry = QRect();
|
||||
|
||||
const QList<QScreen *> screens = QGuiApplication::screens();
|
||||
|
||||
for (const QScreen *screen : screens) {
|
||||
const int indexName = screensNames.indexOf(screen->name());
|
||||
if (indexName != -1) {
|
||||
const auto screenGeom = screen->geometry();
|
||||
if (!screenGeom.isValid()) {
|
||||
close(m_fd);
|
||||
clearState();
|
||||
sendErrorReply(s_errorScreenMissing, s_errorScreenMissingMsg + " : " + screen->name());
|
||||
return;
|
||||
}
|
||||
m_scheduledGeometry = m_scheduledGeometry.united(screenGeom);
|
||||
m_orderImg.insert(indexName, screenGeom.topLeft());
|
||||
}
|
||||
}
|
||||
|
||||
if (m_orderImg.size() != screensNames.size()) {
|
||||
close(m_fd);
|
||||
clearState();
|
||||
sendErrorReply(s_errorScreenMissing, s_errorScreenMissingMsg);
|
||||
return;
|
||||
}
|
||||
|
||||
effects->addRepaint(m_scheduledGeometry);
|
||||
}
|
||||
|
||||
QString ScreenShotEffect::screenshotArea(int x, int y, int width, int height, bool captureCursor)
|
||||
{
|
||||
if (!checkCall()) {
|
||||
|
|
|
@ -22,6 +22,11 @@ class ComparableQPoint;
|
|||
namespace KWin
|
||||
{
|
||||
|
||||
/**
|
||||
* The screenshot effet allows to takes screenshot, by window, area, screen, etc...
|
||||
*
|
||||
* A using application must have "org.kde.kwin.Screenshot" in its X-KDE-DBUS-Restricted-Interfaces application service file field.
|
||||
*/
|
||||
class ScreenShotEffect : public Effect, protected QDBusContext
|
||||
{
|
||||
Q_OBJECT
|
||||
|
@ -77,10 +82,7 @@ public Q_SLOTS:
|
|||
*/
|
||||
Q_SCRIPTABLE QString screenshotFullscreen(bool captureCursor = false);
|
||||
/**
|
||||
* Starts an interactive screenshot session.
|
||||
*
|
||||
* The user is asked to confirm that a screenshot is taken by having to actively
|
||||
* click and giving the possibility to cancel.
|
||||
* Takes a full screen screenshot in a one file format.
|
||||
*
|
||||
* Once the screenshot is taken it gets saved into the @p fd passed to the
|
||||
* method. It is intended to be used with a pipe, so that the invoking side can just
|
||||
|
@ -91,6 +93,16 @@ public Q_SLOTS:
|
|||
* @param shouldReturnNativeSize Whether to return an image according to the virtualGeometry, or according to pixel on screen size
|
||||
*/
|
||||
Q_SCRIPTABLE void screenshotFullscreen(QDBusUnixFileDescriptor fd, bool captureCursor = false, bool shouldReturnNativeSize = false);
|
||||
/**
|
||||
* Take a screenshot of the passed screens and return a QList<QImage> in the fd response,
|
||||
* an image for each screen in pixel-on-screen size when shouldReturnNativeSize is passed, or converted to using logicale size if not
|
||||
*
|
||||
* @param fd
|
||||
* @param screensNames the names of the screens whose screenshot to return
|
||||
* @param captureCursor
|
||||
* @param shouldReturnNativeSize
|
||||
*/
|
||||
Q_SCRIPTABLE void screenshotScreens(QDBusUnixFileDescriptor fd, const QStringList &screensNames, bool captureCursor = false, bool shouldReturnNativeSize = false);
|
||||
/**
|
||||
* Saves a screenshot of the screen identified by @p screen into a file and returns the path to the file.
|
||||
* Functionality requires hardware support, if not available a null string is returned.
|
||||
|
@ -135,6 +147,8 @@ private:
|
|||
QImage blitScreenshot(const QRect &geometry, const qreal scale = 1.0);
|
||||
QString saveTempImage(const QImage &img);
|
||||
void sendReplyImage(const QImage &img);
|
||||
void sendReplyImages();
|
||||
void clearState();
|
||||
enum class InfoMessageMode {
|
||||
Window,
|
||||
Screen
|
||||
|
@ -152,6 +166,7 @@ private:
|
|||
QRect m_cachedOutputGeometry;
|
||||
QRegion m_multipleOutputsRendered;
|
||||
QMap<ComparableQPoint, QImage> m_cacheOutputsImages;
|
||||
QList<QPoint> m_orderImg;
|
||||
bool m_captureCursor = false;
|
||||
bool m_nativeSize = false;
|
||||
enum class WindowMode {
|
||||
|
|
|
@ -22,6 +22,7 @@ Name[nn]=Avslutt økt
|
|||
Name[pl]=Opuszczenie sesji
|
||||
Name[pt]=Saída da Sessão
|
||||
Name[pt_BR]=Saída da sessão
|
||||
Name[ro]=Părăsirea sesiunii
|
||||
Name[ru]=Завершение сеанса
|
||||
Name[sk]=Ukončenie sedenia
|
||||
Name[sl]=Zapri sejo
|
||||
|
@ -51,6 +52,7 @@ Comment[nn]=Hald skrivebordsbakgrunnen i live heilt til utlogginga er fullført
|
|||
Comment[pl]=Utrzymuj tło pulpitu podczas wylogowania, aż do końca
|
||||
Comment[pt]=Manter o fundo do ecrã activo durante a saída da sessão até ao fim
|
||||
Comment[pt_BR]=Mantém ativo o fundo da área de trabalho até o fim do fechamento da sessão
|
||||
Comment[ro]=Păstrează viu fundalul biroului în timpul ieșirii din sesiune până la capăt
|
||||
Comment[ru]=Сохранение фона рабочего стола до окончания завершения сеанса
|
||||
Comment[sk]=Ponechať pozadie plochy aktívne počas odhlásenia do skončenia
|
||||
Comment[sl]=Pusti ozadje namizja živo ob odjavi do konca
|
||||
|
|
|
@ -62,7 +62,7 @@ Name[pa]=FPS ਵੇਖੋ
|
|||
Name[pl]=Pokaż ilość klatek na sekundę
|
||||
Name[pt]=Mostrar as IPS
|
||||
Name[pt_BR]=Mostrar FPS
|
||||
Name[ro]=Afișează CPS
|
||||
Name[ro]=Arată CPS
|
||||
Name[ru]=График производительности
|
||||
Name[se]=Čájet rámmaid sekunddas
|
||||
Name[si]=FPS පෙන්වන්න
|
||||
|
|
|
@ -53,8 +53,8 @@ ShowPaintEffectConfig::ShowPaintEffectConfig(QWidget *parent, const QVariantList
|
|||
|
||||
ShowPaintEffectConfig::~ShowPaintEffectConfig()
|
||||
{
|
||||
// If save() is called, undoChanges() has no effect.
|
||||
m_ui->shortcutsEditor->undoChanges();
|
||||
// If save() is called, undo() has no effect.
|
||||
m_ui->shortcutsEditor->undo();
|
||||
|
||||
delete m_ui;
|
||||
}
|
||||
|
|
|
@ -56,7 +56,7 @@ Name[pa]=ਪੇਂਟ ਵੇਖੋ
|
|||
Name[pl]=Pokaż rysowane
|
||||
Name[pt]=Mostrar a Pintura
|
||||
Name[pt_BR]=Mostrar pintura
|
||||
Name[ro]=Afișează desenele
|
||||
Name[ro]=Arată vopseaua
|
||||
Name[ru]=Подсвечивать отрисовку
|
||||
Name[se]=Čájet málema
|
||||
Name[si]=ඇඳීම් පෙන්වන්න
|
||||
|
|
|
@ -41,6 +41,8 @@ SlidingPopupsEffect::SlidingPopupsEffect()
|
|||
connect(effects, &EffectsHandler::windowClosed, this, &SlidingPopupsEffect::slideOut);
|
||||
connect(effects, &EffectsHandler::windowDeleted, this, &SlidingPopupsEffect::slotWindowDeleted);
|
||||
connect(effects, &EffectsHandler::propertyNotify, this, &SlidingPopupsEffect::slotPropertyNotify);
|
||||
connect(effects, &EffectsHandler::windowShown, this, &SlidingPopupsEffect::slideIn);
|
||||
connect(effects, &EffectsHandler::windowHidden, this, &SlidingPopupsEffect::slideOut);
|
||||
connect(effects, &EffectsHandler::xcbConnectionChanged, this,
|
||||
[this] {
|
||||
m_atom = effects->announceSupportProperty(QByteArrayLiteral("_KDE_SLIDE"), this);
|
||||
|
|
|
@ -22,6 +22,7 @@ Comment[nn]=Skvis vindauge når dei vert minimerte
|
|||
Comment[pl]=Ściąga okna przy ich minimalizacji
|
||||
Comment[pt]=Esmagar as janelas quando são minimizadas
|
||||
Comment[pt_BR]=Achatar as janelas quando são minimizadas
|
||||
Comment[ro]=Strivește ferestrele când sunt minimizate
|
||||
Comment[ru]=Сжатие окна при сворачивании
|
||||
Comment[sk]=Deformuje okná pri ich minimalizovaní
|
||||
Comment[sl]=Zmečkaj okna, ko jih strneš
|
||||
|
@ -54,6 +55,7 @@ Name[nn]=Skvis
|
|||
Name[pl]=Ściąganie
|
||||
Name[pt]=Esmagar
|
||||
Name[pt_BR]=Achatar
|
||||
Name[ro]=Strivire
|
||||
Name[ru]=Сжатие
|
||||
Name[sk]=Rozpučiť
|
||||
Name[sl]=Zmečkaj
|
||||
|
|
|
@ -73,7 +73,7 @@ void ThumbnailAsideEffect::paintWindow(EffectWindow *w, int mask, QRegion region
|
|||
painted |= region;
|
||||
}
|
||||
|
||||
void ThumbnailAsideEffect::slotWindowDamaged(EffectWindow* w, const QRect&)
|
||||
void ThumbnailAsideEffect::slotWindowDamaged(EffectWindow* w, const QRegion&)
|
||||
{
|
||||
foreach (const Data & d, windows) {
|
||||
if (d.window == w)
|
||||
|
|
|
@ -55,7 +55,7 @@ private Q_SLOTS:
|
|||
void toggleCurrentThumbnail();
|
||||
void slotWindowClosed(KWin::EffectWindow *w);
|
||||
void slotWindowFrameGeometryChanged(KWin::EffectWindow *w, const QRect &old);
|
||||
void slotWindowDamaged(KWin::EffectWindow* w, const QRect& damage);
|
||||
void slotWindowDamaged(KWin::EffectWindow* w, const QRegion& damage);
|
||||
bool isActive() const override;
|
||||
void repaintAll();
|
||||
private:
|
||||
|
|
|
@ -72,7 +72,7 @@ ThumbnailAsideEffectConfig::ThumbnailAsideEffectConfig(QWidget* parent, const QV
|
|||
ThumbnailAsideEffectConfig::~ThumbnailAsideEffectConfig()
|
||||
{
|
||||
// Undo (only) unsaved changes to global key shortcuts
|
||||
m_ui->editor->undoChanges();
|
||||
m_ui->editor->undo();
|
||||
}
|
||||
|
||||
void ThumbnailAsideEffectConfig::save()
|
||||
|
|
|
@ -43,7 +43,7 @@ Name[ja]=サムネイルをわきに表示
|
|||
Name[kk]=Нобайды шеттеу
|
||||
Name[km]=រូបភាពតូចនៅខាង
|
||||
Name[kn]=ಸೂಚ್ಯಚಿತ್ರ ಬದಿಯಲ್ಲಿ
|
||||
Name[ko]=미리 보기 그림
|
||||
Name[ko]=옆쪽에 축소판
|
||||
Name[lt]=Miniatiūra šone
|
||||
Name[lv]=Sīktēli malā
|
||||
Name[mai]=लघुछवि बाजू मे
|
||||
|
|
|
@ -61,6 +61,7 @@ Comment[nl]=Verplaats vensters in de hoeken van het scherm
|
|||
Comment[nn]=Flytt vindauge til skjermhjørne
|
||||
Comment[pt]=Mover as janelas para os cantos do ecrã
|
||||
Comment[pt_BR]=Move as janelas para os cantos da tela
|
||||
Comment[ro]=Mută ferestrele în colțurile ecranului
|
||||
Comment[ru]=Перемещение окон в углы экрана
|
||||
Comment[sk]=Presunúť okná do rohov obrazovky
|
||||
Comment[sl]=Pomakne okna v kote zaslona
|
||||
|
|
|
@ -61,7 +61,7 @@ WindowGeometryConfig::WindowGeometryConfig(QWidget* parent, const QVariantList&
|
|||
WindowGeometryConfig::~WindowGeometryConfig()
|
||||
{
|
||||
// Undo (only) unsaved changes to global key shortcuts
|
||||
myUi->shortcuts->undoChanges();
|
||||
myUi->shortcuts->undo();
|
||||
}
|
||||
|
||||
void WindowGeometryConfig::save()
|
||||
|
|
|
@ -126,7 +126,7 @@ ZoomEffectConfig::ZoomEffectConfig(QWidget* parent, const QVariantList& args) :
|
|||
ZoomEffectConfig::~ZoomEffectConfig()
|
||||
{
|
||||
// Undo (only) unsaved changes to global key shortcuts
|
||||
m_ui->editor->undoChanges();
|
||||
m_ui->editor->undo();
|
||||
}
|
||||
|
||||
void ZoomEffectConfig::save()
|
||||
|
|
|
@ -67,7 +67,7 @@ Name[pa]=ਜ਼ੂਮ
|
|||
Name[pl]=Powiększanie
|
||||
Name[pt]=Ampliação
|
||||
Name[pt_BR]=Zoom
|
||||
Name[ro]=Scalare
|
||||
Name[ro]=Apropiere
|
||||
Name[ru]=Масштаб
|
||||
Name[se]=Stuorrudit
|
||||
Name[si]=විශාලණය
|
||||
|
|
54
events.cpp
54
events.cpp
|
@ -165,18 +165,34 @@ QVector<QByteArray> s_xcbEerrors({
|
|||
|
||||
void Workspace::registerEventFilter(X11EventFilter *filter)
|
||||
{
|
||||
if (filter->isGenericEvent())
|
||||
m_genericEventFilters.append(filter);
|
||||
else
|
||||
m_eventFilters.append(filter);
|
||||
if (filter->isGenericEvent()) {
|
||||
m_genericEventFilters.append(new X11EventFilterContainer(filter));
|
||||
} else {
|
||||
m_eventFilters.append(new X11EventFilterContainer(filter));
|
||||
}
|
||||
}
|
||||
|
||||
static X11EventFilterContainer *takeEventFilter(X11EventFilter *eventFilter,
|
||||
QList<QPointer<X11EventFilterContainer>> &list)
|
||||
{
|
||||
for (int i = 0; i < list.count(); ++i) {
|
||||
X11EventFilterContainer *container = list.at(i);
|
||||
if (container->filter() == eventFilter) {
|
||||
return list.takeAt(i);
|
||||
}
|
||||
}
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
void Workspace::unregisterEventFilter(X11EventFilter *filter)
|
||||
{
|
||||
if (filter->isGenericEvent())
|
||||
m_genericEventFilters.removeOne(filter);
|
||||
else
|
||||
m_eventFilters.removeOne(filter);
|
||||
X11EventFilterContainer *container = nullptr;
|
||||
if (filter->isGenericEvent()) {
|
||||
container = takeEventFilter(filter, m_genericEventFilters);
|
||||
} else {
|
||||
container = takeEventFilter(filter, m_eventFilters);
|
||||
}
|
||||
delete container;
|
||||
}
|
||||
|
||||
|
||||
|
@ -219,13 +235,29 @@ bool Workspace::workspaceEvent(xcb_generic_event_t *e)
|
|||
if (eventType == XCB_GE_GENERIC) {
|
||||
xcb_ge_generic_event_t *ge = reinterpret_cast<xcb_ge_generic_event_t *>(e);
|
||||
|
||||
foreach (X11EventFilter *filter, m_genericEventFilters) {
|
||||
// We need to make a shadow copy of the event filter list because an activated event
|
||||
// filter may mutate it by removing or installing another event filter.
|
||||
const auto eventFilters = m_genericEventFilters;
|
||||
|
||||
for (X11EventFilterContainer *container : eventFilters) {
|
||||
if (!container) {
|
||||
continue;
|
||||
}
|
||||
X11EventFilter *filter = container->filter();
|
||||
if (filter->extension() == ge->extension && filter->genericEventTypes().contains(ge->event_type) && filter->event(e)) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
} else {
|
||||
foreach (X11EventFilter *filter, m_eventFilters) {
|
||||
// We need to make a shadow copy of the event filter list because an activated event
|
||||
// filter may mutate it by removing or installing another event filter.
|
||||
const auto eventFilters = m_eventFilters;
|
||||
|
||||
for (X11EventFilterContainer *container : eventFilters) {
|
||||
if (!container) {
|
||||
continue;
|
||||
}
|
||||
X11EventFilter *filter = container->filter();
|
||||
if (filter->eventTypes().contains(eventType) && filter->event(e)) {
|
||||
return true;
|
||||
}
|
||||
|
@ -1290,7 +1322,7 @@ bool Unmanaged::windowEvent(xcb_generic_event_t *e)
|
|||
// It's of course still possible that we miss the destroy in which case non-fatal
|
||||
// X errors are reported to the event loop and logged by Qt.
|
||||
m_scheduledRelease = true;
|
||||
QTimer::singleShot(1, this, SLOT(release()));
|
||||
QTimer::singleShot(1, this, [this]() { release(); });
|
||||
break;
|
||||
}
|
||||
case XCB_CONFIGURE_NOTIFY:
|
||||
|
|
|
@ -0,0 +1,467 @@
|
|||
/*
|
||||
KWin - the KDE window manager
|
||||
This file is part of the KDE project.
|
||||
|
||||
SPDX-FileCopyrightText: 2016 Martin Gräßlin <mgraesslin@kde.org>
|
||||
|
||||
SPDX-License-Identifier: GPL-2.0-or-later
|
||||
*/
|
||||
#include "inputmethod.h"
|
||||
#include "virtualkeyboard_dbus.h"
|
||||
#include "input.h"
|
||||
#include "keyboard_input.h"
|
||||
#include "utils.h"
|
||||
#include "screens.h"
|
||||
#include "wayland_server.h"
|
||||
#include "workspace.h"
|
||||
#include "screenlockerwatcher.h"
|
||||
|
||||
#include <KWaylandServer/display.h>
|
||||
#include <KWaylandServer/seat_interface.h>
|
||||
#include <KWaylandServer/textinput_v2_interface.h>
|
||||
#include <KWaylandServer/textinput_v3_interface.h>
|
||||
#include <KWaylandServer/surface_interface.h>
|
||||
#include <KWaylandServer/inputmethod_v1_interface.h>
|
||||
|
||||
#include <KStatusNotifierItem>
|
||||
#include <KLocalizedString>
|
||||
|
||||
#include <QDBusConnection>
|
||||
#include <QDBusPendingCall>
|
||||
#include <QDBusMessage>
|
||||
|
||||
#include <linux/input-event-codes.h>
|
||||
#include <xkbcommon/xkbcommon-keysyms.h>
|
||||
|
||||
using namespace KWaylandServer;
|
||||
|
||||
namespace KWin
|
||||
{
|
||||
|
||||
KWIN_SINGLETON_FACTORY(InputMethod)
|
||||
|
||||
InputMethod::InputMethod(QObject *parent)
|
||||
: QObject(parent)
|
||||
{
|
||||
// this is actually too late. Other processes are started before init,
|
||||
// so might miss the availability of text input
|
||||
// but without Workspace we don't have the window listed at all
|
||||
connect(kwinApp(), &Application::workspaceCreated, this, &InputMethod::init);
|
||||
}
|
||||
|
||||
InputMethod::~InputMethod() = default;
|
||||
|
||||
void InputMethod::init()
|
||||
{
|
||||
connect(ScreenLockerWatcher::self(), &ScreenLockerWatcher::aboutToLock, this, &InputMethod::hide);
|
||||
|
||||
if (waylandServer()) {
|
||||
m_enabled = !input()->hasAlphaNumericKeyboard();
|
||||
qCDebug(KWIN_VIRTUALKEYBOARD) << "enabled by default: " << m_enabled;
|
||||
connect(input(), &InputRedirection::hasAlphaNumericKeyboardChanged, this,
|
||||
[this] (bool set) {
|
||||
qCDebug(KWIN_VIRTUALKEYBOARD) << "AlphaNumeric Keyboard changed:" << set << "toggling virtual keyboard.";
|
||||
setEnabled(!set);
|
||||
}
|
||||
);
|
||||
}
|
||||
|
||||
qCDebug(KWIN_VIRTUALKEYBOARD) << "Registering the SNI";
|
||||
m_sni = new KStatusNotifierItem(QStringLiteral("kwin-virtual-keyboard"), this);
|
||||
m_sni->setStandardActionsEnabled(false);
|
||||
m_sni->setCategory(KStatusNotifierItem::Hardware);
|
||||
m_sni->setStatus(KStatusNotifierItem::Passive);
|
||||
m_sni->setTitle(i18n("Virtual Keyboard"));
|
||||
updateSni();
|
||||
connect(m_sni, &KStatusNotifierItem::activateRequested, this,
|
||||
[this] {
|
||||
setEnabled(!m_enabled);
|
||||
}
|
||||
);
|
||||
connect(this, &InputMethod::enabledChanged, this, &InputMethod::updateSni);
|
||||
|
||||
auto dbus = new VirtualKeyboardDBus(this);
|
||||
qCDebug(KWIN_VIRTUALKEYBOARD) << "Registering the DBus interface";
|
||||
dbus->setEnabled(m_enabled);
|
||||
connect(dbus, &VirtualKeyboardDBus::activateRequested, this, &InputMethod::setEnabled);
|
||||
connect(this, &InputMethod::enabledChanged, dbus, &VirtualKeyboardDBus::setEnabled);
|
||||
connect(input(), &InputRedirection::keyStateChanged, this, &InputMethod::hide);
|
||||
|
||||
if (waylandServer()) {
|
||||
waylandServer()->display()->createTextInputManagerV2();
|
||||
waylandServer()->display()->createTextInputManagerV3();
|
||||
|
||||
connect(workspace(), &Workspace::clientAdded, this, &InputMethod::clientAdded);
|
||||
connect(waylandServer()->seat(), &SeatInterface::focusedTextInputSurfaceChanged, this, &InputMethod::handleFocusedSurfaceChanged);
|
||||
|
||||
TextInputV2Interface *textInputV2 = waylandServer()->seat()->textInputV2();
|
||||
connect(textInputV2, &TextInputV2Interface::requestShowInputPanel, this, &InputMethod::show);
|
||||
connect(textInputV2, &TextInputV2Interface::requestHideInputPanel, this, &InputMethod::hide);
|
||||
connect(textInputV2, &TextInputV2Interface::surroundingTextChanged, this, &InputMethod::surroundingTextChanged);
|
||||
connect(textInputV2, &TextInputV2Interface::contentTypeChanged, this, &InputMethod::contentTypeChanged);
|
||||
connect(textInputV2, &TextInputV2Interface::requestReset, this, &InputMethod::requestReset);
|
||||
connect(textInputV2, &TextInputV2Interface::enabledChanged, this, &InputMethod::textInputInterfaceV2EnabledChanged);
|
||||
connect(textInputV2, &TextInputV2Interface::stateCommitted, this, &InputMethod::stateCommitted);
|
||||
|
||||
TextInputV3Interface *textInputV3 = waylandServer()->seat()->textInputV3();
|
||||
connect(textInputV3, &TextInputV3Interface::enabledChanged, this, &InputMethod::textInputInterfaceV3EnabledChanged);
|
||||
connect(textInputV3, &TextInputV3Interface::surroundingTextChanged, this, &InputMethod::surroundingTextChanged);
|
||||
connect(textInputV3, &TextInputV3Interface::contentTypeChanged, this, &InputMethod::contentTypeChanged);
|
||||
connect(textInputV3, &TextInputV3Interface::stateCommitted, this, &InputMethod::stateCommitted);
|
||||
}
|
||||
}
|
||||
|
||||
void InputMethod::show()
|
||||
{
|
||||
auto t = waylandServer()->seat()->textInputV2();
|
||||
if (t) {
|
||||
//FIXME: this shouldn't be necessary and causes double emits?
|
||||
Q_EMIT t->enabledChanged();
|
||||
}
|
||||
}
|
||||
|
||||
void InputMethod::hide()
|
||||
{
|
||||
waylandServer()->inputMethod()->sendDeactivate();
|
||||
updateInputPanelState();
|
||||
}
|
||||
|
||||
void InputMethod::clientAdded(AbstractClient* client)
|
||||
{
|
||||
if (!client->isInputMethod()) {
|
||||
return;
|
||||
}
|
||||
m_inputClient = client;
|
||||
auto refreshFrame = [this] {
|
||||
if (!m_trackedClient) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (m_inputClient && !m_inputClient->inputGeometry().isEmpty()) {
|
||||
m_trackedClient->setVirtualKeyboardGeometry(m_inputClient->inputGeometry());
|
||||
}
|
||||
};
|
||||
connect(client->surface(), &SurfaceInterface::inputChanged, this, refreshFrame);
|
||||
connect(client, &QObject::destroyed, this, [this] {
|
||||
if (m_trackedClient) {
|
||||
m_trackedClient->setVirtualKeyboardGeometry({});
|
||||
}
|
||||
});
|
||||
connect(m_inputClient, &AbstractClient::frameGeometryChanged, this, refreshFrame);
|
||||
}
|
||||
|
||||
void InputMethod::handleFocusedSurfaceChanged()
|
||||
{
|
||||
SurfaceInterface *focusedSurface = waylandServer()->seat()->focusedTextInputSurface();
|
||||
if (focusedSurface) {
|
||||
AbstractClient *focusedClient = waylandServer()->findClient(focusedSurface);
|
||||
// Reset the old client virtual keybaord geom if necessary
|
||||
// Old and new clients could be the same if focus moves between subsurfaces
|
||||
if (m_trackedClient != focusedClient) {
|
||||
if (m_trackedClient) {
|
||||
m_trackedClient->setVirtualKeyboardGeometry(QRect());
|
||||
}
|
||||
m_trackedClient = focusedClient;
|
||||
}
|
||||
} else {
|
||||
waylandServer()->inputMethod()->sendDeactivate();
|
||||
}
|
||||
updateInputPanelState();
|
||||
}
|
||||
|
||||
void InputMethod::surroundingTextChanged()
|
||||
{
|
||||
auto t2 = waylandServer()->seat()->textInputV2();
|
||||
auto t3 = waylandServer()->seat()->textInputV3();
|
||||
auto inputContext = waylandServer()->inputMethod()->context();
|
||||
if (!inputContext) {
|
||||
return;
|
||||
}
|
||||
if (t2 && t2->isEnabled()) {
|
||||
inputContext->sendSurroundingText(t2->surroundingText(), t2->surroundingTextCursorPosition(), t2->surroundingTextSelectionAnchor());
|
||||
return;
|
||||
}
|
||||
if (t3 && t3->isEnabled()) {
|
||||
inputContext->sendSurroundingText(t3->surroundingText(), t3->surroundingTextCursorPosition(), t3->surroundingTextSelectionAnchor());
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
void InputMethod::contentTypeChanged()
|
||||
{
|
||||
auto t2 = waylandServer()->seat()->textInputV2();
|
||||
auto t3 = waylandServer()->seat()->textInputV3();
|
||||
auto inputContext = waylandServer()->inputMethod()->context();
|
||||
if (!inputContext) {
|
||||
return;
|
||||
}
|
||||
if (t2 && t2->isEnabled()) {
|
||||
inputContext->sendContentType(t2->contentHints(), t2->contentPurpose());
|
||||
}
|
||||
if (t3 && t3->isEnabled()) {
|
||||
inputContext->sendContentType(t3->contentHints(), t3->contentPurpose());
|
||||
}
|
||||
}
|
||||
|
||||
void InputMethod::requestReset()
|
||||
{
|
||||
auto t2 = waylandServer()->seat()->textInputV2();
|
||||
auto inputContext = waylandServer()->inputMethod()->context();
|
||||
if (!inputContext) {
|
||||
return;
|
||||
}
|
||||
inputContext->sendReset();
|
||||
if (t2 && t2->isEnabled()) {
|
||||
inputContext->sendSurroundingText(t2->surroundingText(), t2->surroundingTextCursorPosition(), t2->surroundingTextSelectionAnchor());
|
||||
inputContext->sendPreferredLanguage(t2->preferredLanguage());
|
||||
inputContext->sendContentType(t2->contentHints(), t2->contentPurpose());
|
||||
}
|
||||
}
|
||||
|
||||
void InputMethod::textInputInterfaceV2EnabledChanged()
|
||||
{
|
||||
auto t = waylandServer()->seat()->textInputV2();
|
||||
if (t->isEnabled()) {
|
||||
//FIXME This sendDeactivate shouldn't be necessary?
|
||||
waylandServer()->inputMethod()->sendDeactivate();
|
||||
waylandServer()->inputMethod()->sendActivate();
|
||||
adoptInputMethodContext();
|
||||
} else {
|
||||
waylandServer()->inputMethod()->sendDeactivate();
|
||||
hide();
|
||||
}
|
||||
}
|
||||
|
||||
void InputMethod::textInputInterfaceV3EnabledChanged()
|
||||
{
|
||||
auto t3 = waylandServer()->seat()->textInputV3();
|
||||
if (t3->isEnabled()) {
|
||||
waylandServer()->inputMethod()->sendActivate();
|
||||
adoptInputMethodContext();
|
||||
} else {
|
||||
waylandServer()->inputMethod()->sendDeactivate();
|
||||
// reset value of preedit when textinput is disabled
|
||||
preedit.text = QString();
|
||||
preedit.begin = 0;
|
||||
preedit.end = 0;
|
||||
}
|
||||
}
|
||||
|
||||
void InputMethod::stateCommitted(uint32_t serial)
|
||||
{
|
||||
auto inputContext = waylandServer()->inputMethod()->context();
|
||||
if (!inputContext) {
|
||||
return;
|
||||
}
|
||||
inputContext->sendCommitState(serial);
|
||||
}
|
||||
|
||||
void InputMethod::setEnabled(bool enabled)
|
||||
{
|
||||
if (m_enabled == enabled) {
|
||||
return;
|
||||
}
|
||||
m_enabled = enabled;
|
||||
emit enabledChanged(m_enabled);
|
||||
|
||||
// send OSD message
|
||||
QDBusMessage msg = QDBusMessage::createMethodCall(
|
||||
QStringLiteral("org.kde.plasmashell"),
|
||||
QStringLiteral("/org/kde/osdService"),
|
||||
QStringLiteral("org.kde.osdService"),
|
||||
QStringLiteral("virtualKeyboardEnabledChanged")
|
||||
);
|
||||
msg.setArguments({enabled});
|
||||
QDBusConnection::sessionBus().asyncCall(msg);
|
||||
}
|
||||
|
||||
static quint32 keysymToKeycode(quint32 sym)
|
||||
{
|
||||
switch(sym) {
|
||||
case XKB_KEY_BackSpace:
|
||||
return KEY_BACKSPACE;
|
||||
case XKB_KEY_Return:
|
||||
return KEY_ENTER;
|
||||
case XKB_KEY_Left:
|
||||
return KEY_LEFT;
|
||||
case XKB_KEY_Right:
|
||||
return KEY_RIGHT;
|
||||
case XKB_KEY_Up:
|
||||
return KEY_UP;
|
||||
case XKB_KEY_Down:
|
||||
return KEY_DOWN;
|
||||
default:
|
||||
return KEY_UNKNOWN;
|
||||
}
|
||||
}
|
||||
|
||||
static void keysymReceived(quint32 serial, quint32 time, quint32 sym, bool pressed, Qt::KeyboardModifiers modifiers)
|
||||
{
|
||||
Q_UNUSED(serial)
|
||||
Q_UNUSED(time)
|
||||
auto t2 = waylandServer()->seat()->textInputV2();
|
||||
if (t2 && t2->isEnabled()) {
|
||||
if (pressed) {
|
||||
t2->keysymPressed(sym, modifiers);
|
||||
} else {
|
||||
t2->keysymReleased(sym, modifiers);
|
||||
}
|
||||
return;
|
||||
}
|
||||
auto t3 = waylandServer()->seat()->textInputV3();
|
||||
if (t3 && t3->isEnabled()) {
|
||||
if (pressed) {
|
||||
waylandServer()->seat()->keyPressed(keysymToKeycode(sym));
|
||||
} else {
|
||||
waylandServer()->seat()->keyReleased(keysymToKeycode(sym));
|
||||
}
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
static void commitString(qint32 serial, const QString &text)
|
||||
{
|
||||
Q_UNUSED(serial)
|
||||
auto t2 = waylandServer()->seat()->textInputV2();
|
||||
if (t2 && t2->isEnabled()) {
|
||||
t2->commitString(text.toUtf8());
|
||||
t2->preEdit({}, {});
|
||||
return;
|
||||
}
|
||||
auto t3 = waylandServer()->seat()->textInputV3();
|
||||
if (t3 && t3->isEnabled()) {
|
||||
t3->commitString(text.toUtf8());
|
||||
t3->done();
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
static void deleteSurroundingText(int32_t index, uint32_t length)
|
||||
{
|
||||
auto t2 = waylandServer()->seat()->textInputV2();
|
||||
if (t2 && t2->isEnabled()) {
|
||||
t2->deleteSurroundingText(index, length);
|
||||
}
|
||||
auto t3 = waylandServer()->seat()->textInputV3();
|
||||
if (t3 && t3->isEnabled()) {
|
||||
t3->deleteSurroundingText(index, length);
|
||||
}
|
||||
}
|
||||
|
||||
static void setCursorPosition(qint32 index, qint32 anchor)
|
||||
{
|
||||
auto t2 = waylandServer()->seat()->textInputV2();
|
||||
if (t2 && t2->isEnabled()) {
|
||||
t2->setCursorPosition(index, anchor);
|
||||
}
|
||||
}
|
||||
|
||||
static void setLanguage(uint32_t serial, const QString &language)
|
||||
{
|
||||
Q_UNUSED(serial)
|
||||
auto t2 = waylandServer()->seat()->textInputV2();
|
||||
if (t2 && t2->isEnabled()) {
|
||||
t2->setLanguage(language.toUtf8());
|
||||
}
|
||||
}
|
||||
|
||||
static void setTextDirection(uint32_t serial, Qt::LayoutDirection direction)
|
||||
{
|
||||
Q_UNUSED(serial)
|
||||
auto t2 = waylandServer()->seat()->textInputV2();
|
||||
if (t2 && t2->isEnabled()) {
|
||||
t2->setTextDirection(direction);
|
||||
}
|
||||
}
|
||||
|
||||
void InputMethod::setPreeditCursor(qint32 index)
|
||||
{
|
||||
auto t2 = waylandServer()->seat()->textInputV2();
|
||||
if (t2 && t2->isEnabled()) {
|
||||
t2->setPreEditCursor(index);
|
||||
}
|
||||
auto t3 = waylandServer()->seat()->textInputV3();
|
||||
if (t3 && t3->isEnabled()) {
|
||||
preedit.begin = index;
|
||||
preedit.end = index;
|
||||
t3->sendPreEditString(preedit.text, preedit.begin, preedit.end);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
void InputMethod::setPreeditString(uint32_t serial, const QString &text, const QString &commit)
|
||||
{
|
||||
Q_UNUSED(serial)
|
||||
auto t2 = waylandServer()->seat()->textInputV2();
|
||||
if (t2 && t2->isEnabled()) {
|
||||
t2->preEdit(text.toUtf8(), commit.toUtf8());
|
||||
}
|
||||
auto t3 = waylandServer()->seat()->textInputV3();
|
||||
if (t3 && t3->isEnabled()) {
|
||||
preedit.text = text;
|
||||
t3->sendPreEditString(preedit.text, preedit.begin, preedit.end);
|
||||
}
|
||||
}
|
||||
|
||||
void InputMethod::adoptInputMethodContext()
|
||||
{
|
||||
auto inputContext = waylandServer()->inputMethod()->context();
|
||||
|
||||
TextInputV2Interface *t2 = waylandServer()->seat()->textInputV2();
|
||||
TextInputV3Interface *t3 = waylandServer()->seat()->textInputV3();
|
||||
|
||||
if (t2 && t2->isEnabled()) {
|
||||
inputContext->sendSurroundingText(t2->surroundingText(), t2->surroundingTextCursorPosition(), t2->surroundingTextSelectionAnchor());
|
||||
inputContext->sendPreferredLanguage(t2->preferredLanguage());
|
||||
inputContext->sendContentType(t2->contentHints(), t2->contentPurpose());
|
||||
connect(inputContext, &KWaylandServer::InputMethodContextV1Interface::language, waylandServer(), &setLanguage);
|
||||
connect(inputContext, &KWaylandServer::InputMethodContextV1Interface::textDirection, waylandServer(), &setTextDirection);
|
||||
}
|
||||
|
||||
if (t3 && t3->isEnabled()) {
|
||||
inputContext->sendSurroundingText(t3->surroundingText(), t3->surroundingTextCursorPosition(), t3->surroundingTextSelectionAnchor());
|
||||
inputContext->sendContentType(t3->contentHints(), t3->contentPurpose());
|
||||
}
|
||||
|
||||
connect(inputContext, &KWaylandServer::InputMethodContextV1Interface::keysym, waylandServer(), &keysymReceived);
|
||||
connect(inputContext, &KWaylandServer::InputMethodContextV1Interface::commitString, waylandServer(), &commitString);
|
||||
connect(inputContext, &KWaylandServer::InputMethodContextV1Interface::deleteSurroundingText, waylandServer(), &deleteSurroundingText);
|
||||
connect(inputContext, &KWaylandServer::InputMethodContextV1Interface::cursorPosition, waylandServer(), &setCursorPosition);
|
||||
connect(inputContext, &KWaylandServer::InputMethodContextV1Interface::preeditString, this, &InputMethod::setPreeditString);
|
||||
connect(inputContext, &KWaylandServer::InputMethodContextV1Interface::preeditCursor, this, &InputMethod::setPreeditCursor);
|
||||
}
|
||||
|
||||
void InputMethod::updateSni()
|
||||
{
|
||||
if (!m_sni) {
|
||||
return;
|
||||
}
|
||||
if (m_enabled) {
|
||||
m_sni->setIconByName(QStringLiteral("input-keyboard-virtual-on"));
|
||||
m_sni->setTitle(i18n("Virtual Keyboard: enabled"));
|
||||
} else {
|
||||
m_sni->setIconByName(QStringLiteral("input-keyboard-virtual-off"));
|
||||
m_sni->setTitle(i18n("Virtual Keyboard: disabled"));
|
||||
}
|
||||
m_sni->setToolTipTitle(i18n("Whether to show the virtual keyboard on demand."));
|
||||
}
|
||||
|
||||
void InputMethod::updateInputPanelState()
|
||||
{
|
||||
if (!waylandServer()) {
|
||||
return;
|
||||
}
|
||||
|
||||
auto t = waylandServer()->seat()->textInputV2();
|
||||
|
||||
if (!t) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (m_trackedClient) {
|
||||
m_trackedClient->setVirtualKeyboardGeometry(m_inputClient ? m_inputClient->inputGeometry() : QRect());
|
||||
}
|
||||
t->setInputPanelState(m_inputClient && m_inputClient->isShown(false), QRect(0, 0, 0, 0));
|
||||
}
|
||||
|
||||
}
|
|
@ -0,0 +1,79 @@
|
|||
/*
|
||||
KWin - the KDE window manager
|
||||
This file is part of the KDE project.
|
||||
|
||||
SPDX-FileCopyrightText: 2016 Martin Gräßlin <mgraesslin@kde.org>
|
||||
|
||||
SPDX-License-Identifier: GPL-2.0-or-later
|
||||
*/
|
||||
#ifndef KWIN_VIRTUAL_KEYBOARD_H
|
||||
#define KWIN_VIRTUAL_KEYBOARD_H
|
||||
|
||||
#include <QObject>
|
||||
|
||||
#include <kwinglobals.h>
|
||||
#include <kwin_export.h>
|
||||
|
||||
#include <abstract_client.h>
|
||||
|
||||
class KStatusNotifierItem;
|
||||
|
||||
namespace KWin
|
||||
{
|
||||
|
||||
/**
|
||||
* This class implements the zwp_input_method_unstable_v1, which is currently used to provide
|
||||
* the Virtual Keyboard using supported input method client (maliit-keyboard e.g.)
|
||||
**/
|
||||
class KWIN_EXPORT InputMethod : public QObject
|
||||
{
|
||||
Q_OBJECT
|
||||
public:
|
||||
~InputMethod() override;
|
||||
|
||||
void init();
|
||||
void hide();
|
||||
void show();
|
||||
|
||||
Q_SIGNALS:
|
||||
void enabledChanged(bool enabled);
|
||||
|
||||
private Q_SLOTS:
|
||||
void clientAdded(AbstractClient* client);
|
||||
|
||||
// textinput interface slots
|
||||
void handleFocusedSurfaceChanged();
|
||||
void surroundingTextChanged();
|
||||
void contentTypeChanged();
|
||||
void requestReset();
|
||||
void textInputInterfaceV2EnabledChanged();
|
||||
void textInputInterfaceV3EnabledChanged();
|
||||
void stateCommitted(uint32_t serial);
|
||||
|
||||
// inputcontext slots
|
||||
void setPreeditString(uint32_t serial, const QString &text, const QString &commit);
|
||||
void setPreeditCursor(qint32 index);
|
||||
|
||||
private:
|
||||
void setEnabled(bool enable);
|
||||
void updateSni();
|
||||
void updateInputPanelState();
|
||||
void adoptInputMethodContext();
|
||||
|
||||
struct {
|
||||
QString text = QString();
|
||||
quint32 begin = 0;
|
||||
quint32 end = 0;
|
||||
} preedit;
|
||||
|
||||
bool m_enabled = false;
|
||||
KStatusNotifierItem *m_sni = nullptr;
|
||||
QPointer<AbstractClient> m_inputClient;
|
||||
QPointer<AbstractClient> m_trackedClient;
|
||||
|
||||
KWIN_SINGLETON(InputMethod)
|
||||
};
|
||||
|
||||
}
|
||||
|
||||
#endif
|
|
@ -16,7 +16,7 @@
|
|||
#include <KWaylandServer/output_interface.h>
|
||||
#include <KWaylandServer/seat_interface.h>
|
||||
#include <KWaylandServer/surface_interface.h>
|
||||
#include <KWaylandServer/textinput_interface.h>
|
||||
#include <KWaylandServer/textinput_v2_interface.h>
|
||||
|
||||
using namespace KWaylandServer;
|
||||
|
||||
|
@ -32,7 +32,6 @@ InputPanelV1Client::InputPanelV1Client(InputPanelSurfaceV1Interface *panelSurfac
|
|||
setSkipTaskbar(true);
|
||||
setPositionSyncMode(SyncMode::Sync);
|
||||
setSizeSyncMode(SyncMode::Sync);
|
||||
setupCompositing();
|
||||
|
||||
connect(surface(), &SurfaceInterface::aboutToBeDestroyed, this, &InputPanelV1Client::destroyClient);
|
||||
connect(surface(), &SurfaceInterface::sizeChanged, this, &InputPanelV1Client::reposition);
|
||||
|
@ -79,7 +78,7 @@ void KWin::InputPanelV1Client::reposition()
|
|||
} break;
|
||||
case Overlay: {
|
||||
auto textClient = waylandServer()->findClient(waylandServer()->seat()->focusedTextInputSurface());
|
||||
auto textInput = waylandServer()->seat()->focusedTextInput();
|
||||
auto textInput = waylandServer()->seat()->textInputV2();
|
||||
if (textClient && textInput) {
|
||||
const auto cursorRectangle = textInput->cursorRectangle();
|
||||
updateGeometry({textClient->pos() + textClient->clientPos() + cursorRectangle.bottomLeft(), surface()->size()});
|
||||
|
|
|
@ -211,6 +211,11 @@ bool InternalClient::isResizable() const
|
|||
return true;
|
||||
}
|
||||
|
||||
bool InternalClient::isPlaceable() const
|
||||
{
|
||||
return !m_internalWindowFlags.testFlag(Qt::BypassWindowManagerHint) && !m_internalWindowFlags.testFlag(Qt::Popup);
|
||||
}
|
||||
|
||||
bool InternalClient::noBorder() const
|
||||
{
|
||||
return m_userNoBorder || m_internalWindowFlags.testFlag(Qt::FramelessWindowHint) || m_internalWindowFlags.testFlag(Qt::Popup);
|
||||
|
|
|
@ -45,6 +45,7 @@ public:
|
|||
bool isMovable() const override;
|
||||
bool isMovableAcrossScreens() const override;
|
||||
bool isResizable() const override;
|
||||
bool isPlaceable() const override;
|
||||
bool noBorder() const override;
|
||||
bool userCanSetNoBorder() const override;
|
||||
bool wantsInput() const override;
|
||||
|
|
|
@ -597,18 +597,14 @@ static KCModule *findBinaryConfig(const QString &pluginId, QObject *parent)
|
|||
|
||||
static KCModule *findScriptedConfig(const QString &pluginId, QObject *parent)
|
||||
{
|
||||
const auto offers = KPluginTrader::self()->query(
|
||||
QStringLiteral("kwin/effects/configs/"),
|
||||
QString(),
|
||||
QStringLiteral("[X-KDE-Library] == 'kcm_kwin4_genericscripted'")
|
||||
);
|
||||
const QVector<KPluginMetaData> offers = KPluginLoader::findPluginsById(QStringLiteral("kwin/effects/configs/"), QStringLiteral("kcm_kwin4_genericscripted"));
|
||||
|
||||
if (offers.isEmpty()) {
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
const KPluginInfo &generic = offers.first();
|
||||
KPluginLoader loader(generic.libraryPath());
|
||||
const KPluginMetaData &generic = offers.first();
|
||||
KPluginLoader loader(generic.fileName());
|
||||
KPluginFactory *factory = loader.factory();
|
||||
if (!factory) {
|
||||
return nullptr;
|
||||
|
|
|
@ -90,6 +90,7 @@ Comment[pa]=ਡੈਸਕਟਾਪ ਪਰਭਾਵ ਲਈ ਕੰਪੋਜੀਟ
|
|||
Comment[pl]=Ustawienia kompozytora dla efektów pulpitu
|
||||
Comment[pt]=Configuração do Compositor para os Efeitos do Ecrã
|
||||
Comment[pt_BR]=Definições do Compositor para os efeitos da área de trabalho
|
||||
Comment[ro]=Configurări compozitor pentru efecte de birou
|
||||
Comment[ru]=Настройка движка эффектов рабочего стола
|
||||
Comment[sk]=Nastavenia kompozítora pre efekty plochy
|
||||
Comment[sl]=Nastavitve upravljalnika skladnje za učinke namizja
|
||||
|
@ -125,6 +126,7 @@ X-KDE-Keywords[nl]=kwin,window,manager,beheerder,compositing,effecten,3D-effecte
|
|||
X-KDE-Keywords[nn]=kwin,vindauge,vindaugshandsamar,samansetjing,effekt,3D-effektar,2D-effektar,OpenGL,XRender,videoinnstillingar,grafiske effektar,skrivebordseffektar
|
||||
X-KDE-Keywords[pt]=kwin,janela,gestor,composição,efeito,efeitos 3D,efeitos 2D,OpenGL,XRender,configuração do vídeo,efeitos gráficos,efeitos do ecrã
|
||||
X-KDE-Keywords[pt_BR]=kwin,janela,gerenciador,composição,efeito,efeitos 3D,efeitos 2D,OpenGL,XRender,configurações de vídeo,efeitos gráficos,efeitos da área de trabalho
|
||||
X-KDE-Keywords[ro]=kwin,fereastră,gestionar,compoziționare,efect,efecte 3D,OpenGL,XRender,configurări video,efecte grafice,efecte de birou
|
||||
X-KDE-Keywords[ru]=kwin,window,manager,compositing,effect,3D effects,2D effects,OpenGL,XRender,video settings,graphical effects,desktop effects,композитинг,композитный диспетчер окон,эффекты рабочего стола,графические эффекты,рендеринг,параметры видео,настройка видео
|
||||
X-KDE-Keywords[sk]=kwin,okno,správca,kompozícia,efekt,3D efekty,2D efekty,OpenGL,XRender,nastavenia videa,grafické efekty,efekty plochy
|
||||
X-KDE-Keywords[sl]=kwin,okna,upravljalnik,skladnja,učinek,3D učinki,2D učinki,OpenGL,XRender,nastavitve videa,video,grafični učinki,hitrost animacije,učinki namizja
|
||||
|
|
|
@ -10,7 +10,7 @@
|
|||
// KDE
|
||||
#include <KPluginLoader>
|
||||
#include <KPluginFactory>
|
||||
#include <KPluginTrader>
|
||||
#include <KPluginMetaData>
|
||||
// Qt
|
||||
#include <QDebug>
|
||||
|
||||
|
@ -118,9 +118,9 @@ void DecorationsModel::init()
|
|||
{
|
||||
beginResetModel();
|
||||
m_plugins.clear();
|
||||
const auto plugins = KPluginTrader::self()->query(s_pluginName, s_pluginName);
|
||||
const auto plugins = KPluginLoader::findPlugins(s_pluginName);
|
||||
for (const auto &info : plugins) {
|
||||
KPluginLoader loader(info.libraryPath());
|
||||
KPluginLoader loader(info.fileName());
|
||||
KPluginFactory *factory = loader.factory();
|
||||
if (!factory) {
|
||||
continue;
|
||||
|
@ -150,7 +150,7 @@ void DecorationsModel::init()
|
|||
const auto themesMap = themes.toMap();
|
||||
for (auto it = themesMap.begin(); it != themesMap.end(); ++it) {
|
||||
Data d;
|
||||
d.pluginName = info.pluginName();
|
||||
d.pluginName = info.pluginId();
|
||||
d.themeName = it.value().toString();
|
||||
d.visibleName = it.key();
|
||||
QMetaObject::invokeMethod(themeFinder.data(), "hasConfiguration",
|
||||
|
@ -165,8 +165,8 @@ void DecorationsModel::init()
|
|||
data.configuration = isConfigureable(decoSettingsMap);
|
||||
data.recommendedBorderSize = recommendedBorderSize(decoSettingsMap);
|
||||
}
|
||||
data.pluginName = info.pluginName();
|
||||
data.visibleName = info.name().isEmpty() ? info.pluginName() : info.name();
|
||||
data.pluginName = info.pluginId();
|
||||
data.visibleName = info.name().isEmpty() ? info.pluginId() : info.name();
|
||||
data.themeName = data.visibleName;
|
||||
|
||||
m_plugins.emplace_back(std::move(data));
|
||||
|
|
|
@ -242,11 +242,6 @@ bool KCMKWinDecoration::isSaveNeeded() const
|
|||
return !m_settings->borderSizeAuto() && borderSizeIndexFromString(m_settings->borderSize()) != m_borderSizeIndex;
|
||||
}
|
||||
|
||||
bool KCMKWinDecoration::isDefaults() const
|
||||
{
|
||||
return m_settings->borderSizeAuto() && recommendedBorderSize() == m_borderSizeIndex;
|
||||
}
|
||||
|
||||
int KCMKWinDecoration::borderSizeIndexFromString(const QString &size) const
|
||||
{
|
||||
return Utils::getBorderSizeNames().keys().indexOf(Utils::stringToBorderSize(size));
|
||||
|
|
|
@ -86,7 +86,6 @@ private Q_SLOTS:
|
|||
|
||||
private:
|
||||
bool isSaveNeeded() const override;
|
||||
bool isDefaults() const override;
|
||||
|
||||
int borderSizeIndexFromString(const QString &size) const;
|
||||
QString borderSizeIndexToString(int index) const;
|
||||
|
|
|
@ -25,7 +25,7 @@ Name[da]=Vinduesdekorationer
|
|||
Name[de]=Fensterdekoration
|
||||
Name[el]=Διακοσμήσεις παραθύρου
|
||||
Name[en_GB]=Window Decorations
|
||||
Name[es]=Decoración de ventanas
|
||||
Name[es]=Decoraciones de las ventanas
|
||||
Name[et]=Akna dekoratsioonid
|
||||
Name[eu]=Leiho-apaindurak
|
||||
Name[fi]=Ikkunakehykset
|
||||
|
@ -98,6 +98,7 @@ Comment[nn]=Set opp tittellinjer og vindaugsrammer
|
|||
Comment[pl]=Ustawienia pasków tytułów i obramowań okien
|
||||
Comment[pt]=Configurar as barras de título e contornos das janelas
|
||||
Comment[pt_BR]=Configure as barras de títulos e bordas da janela
|
||||
Comment[ro]=Configurează barele de titlu și contururile ferestrelor
|
||||
Comment[ru]=Настройка заголовка и границ окон
|
||||
Comment[sk]=Nastaviť záhlavia a okraje okna
|
||||
Comment[sl]=Nastavi naslovne vrstice in robove oken
|
||||
|
@ -139,6 +140,7 @@ X-KDE-Keywords[nn]=kwin,vindauge,handsamar,ramme,kantlinje,stil,tema,lås,utform
|
|||
X-KDE-Keywords[pl]=kwin,okno,menadżer,obramowanie,styl,motyw,wygląd,odczucie,układ,przycisk, uchwyt,krawędź,kwm,dekoracja
|
||||
X-KDE-Keywords[pt]=kwin,gestor,janela,contorno,estilo,tema,aparência,comportamento,disposição,botão,pega,extremo,kwm,decoração
|
||||
X-KDE-Keywords[pt_BR]=kwin,gerenciador,janela,borda,estilo,tema,aparência,comportamento,layout,botão,canto,extremo,kwm,decoração
|
||||
X-KDE-Keywords[ro]=kwin,fereastră,gestionar,contur,stil,tematică,aspect,comportament,aranjament,mâner,muchie,margine,kwm,decorație
|
||||
X-KDE-Keywords[ru]=kwin,window,manager,border,style,theme,look,feel,layout,button,handle,edge,kwm,decoration,окно,диспетчер,граница,стиль,тема,внешний вид,оформление,разметка,шаблон,кнопка,управление,край
|
||||
X-KDE-Keywords[sk]=kwin,okno,správca,rám,štýl,téma,vzhľad,cítenie,rozloženie,tlačidlo,spracovanie,okraj,kwm,dekorácia
|
||||
X-KDE-Keywords[sl]=kwin,okna,okenski upravljalnik,upravljalnik oken,rob,obroba,slog,tema,videz,obnašanje,občutek,razpored,gumbi,ročica,okraski,kwm
|
||||
|
|
|
@ -33,6 +33,7 @@ ListView {
|
|||
Drag.active: dragArea.drag.active
|
||||
Drag.onActiveChanged: view.dragging = Drag.active
|
||||
color: palette.windowText
|
||||
opacity: parent.enabled ? 1.0 : 0.3
|
||||
}
|
||||
MouseArea {
|
||||
id: dragArea
|
||||
|
|
|
@ -11,6 +11,7 @@ import QtQuick.Controls 2.4 as Controls
|
|||
import org.kde.plasma.core 2.0 as PlasmaCore
|
||||
import org.kde.kirigami 2.5 as Kirigami
|
||||
import org.kde.kwin.private.kdecoration 1.0 as KDecoration
|
||||
import org.kde.kcm 1.3 as KCM
|
||||
|
||||
ColumnLayout {
|
||||
Layout.fillWidth: true
|
||||
|
@ -64,7 +65,24 @@ ColumnLayout {
|
|||
iconSize: buttonIconSize
|
||||
model: kcm.leftButtonsModel
|
||||
key: "decoButtonLeft"
|
||||
|
||||
Rectangle {
|
||||
visible: stateBindingButtonLeft.nonDefaultHighlightVisible
|
||||
anchors.fill: parent
|
||||
Layout.margins: units.smallSpacing
|
||||
color: "transparent"
|
||||
border.color: Kirigami.Theme.neutralTextColor
|
||||
border.width: Kirigami.Units.devicePixelRatio
|
||||
radius: units.smallSpacing
|
||||
}
|
||||
|
||||
KCM.SettingStateBinding {
|
||||
id: stateBindingButtonLeft
|
||||
configObject: kcm.settings
|
||||
settingName: "buttonsOnLeft"
|
||||
}
|
||||
}
|
||||
|
||||
Controls.Label {
|
||||
id: titleBarLabel
|
||||
Layout.fillWidth: true
|
||||
|
@ -77,6 +95,22 @@ ColumnLayout {
|
|||
iconSize: buttonIconSize
|
||||
model: kcm.rightButtonsModel
|
||||
key: "decoButtonRight"
|
||||
|
||||
Rectangle {
|
||||
visible: stateBindingButtonRight.nonDefaultHighlightVisible
|
||||
anchors.fill: parent
|
||||
Layout.margins: units.smallSpacing
|
||||
color: "transparent"
|
||||
border.color: Kirigami.Theme.neutralTextColor
|
||||
border.width: Kirigami.Units.devicePixelRatio
|
||||
radius: units.smallSpacing
|
||||
}
|
||||
|
||||
KCM.SettingStateBinding {
|
||||
id: stateBindingButtonRight
|
||||
configObject: kcm.settings
|
||||
settingName: "buttonsOnRight"
|
||||
}
|
||||
}
|
||||
}
|
||||
DropArea {
|
||||
|
@ -94,9 +128,13 @@ ColumnLayout {
|
|||
var left = drag.x - (leftButtonsView.x + leftButtonsView.width);
|
||||
var right = drag.x - rightButtonsView.x;
|
||||
if (Math.abs(left) <= Math.abs(right)) {
|
||||
view = leftButtonsView;
|
||||
if (leftButtonsView.enabled) {
|
||||
view = leftButtonsView;
|
||||
}
|
||||
} else {
|
||||
view = rightButtonsView;
|
||||
if (rightButtonsView.enabled) {
|
||||
view = rightButtonsView;
|
||||
}
|
||||
}
|
||||
if (!view) {
|
||||
return;
|
||||
|
|
|
@ -5,7 +5,7 @@
|
|||
SPDX-License-Identifier: GPL-2.0-only OR GPL-3.0-only OR LicenseRef-KDE-Accepted-GPL
|
||||
*/
|
||||
import QtQuick 2.7
|
||||
import org.kde.kcm 1.1 as KCM
|
||||
import org.kde.kcm 1.3 as KCM
|
||||
import org.kde.kirigami 2.2 as Kirigami
|
||||
import org.kde.kwin.private.kdecoration 1.0 as KDecoration
|
||||
|
||||
|
|
|
@ -7,11 +7,13 @@
|
|||
import QtQuick 2.7
|
||||
import QtQuick.Layouts 1.3
|
||||
import QtQuick.Controls 2.4 as Controls
|
||||
import org.kde.kcm 1.1 as KCM
|
||||
import org.kde.kcm 1.3 as KCM
|
||||
import org.kde.kconfig 1.0 // for KAuthorized
|
||||
import org.kde.kirigami 2.4 as Kirigami
|
||||
|
||||
Kirigami.Page {
|
||||
id: root
|
||||
|
||||
KCM.ConfigModule.quickHelp: i18n("This module lets you configure the window decorations.")
|
||||
title: kcm.name
|
||||
|
||||
|
@ -62,54 +64,75 @@ Kirigami.Page {
|
|||
|
||||
currentIndex: tabBar.currentIndex
|
||||
|
||||
ColumnLayout {
|
||||
Themes {
|
||||
Layout.fillWidth: true
|
||||
Layout.fillHeight: true
|
||||
enabled: !kcm.settings.isImmutable("pluginName") && !kcm.settings.isImmutable("theme")
|
||||
Item {
|
||||
KCM.SettingStateBinding {
|
||||
target: themes
|
||||
configObject: kcm.settings
|
||||
settingName: "pluginName"
|
||||
}
|
||||
|
||||
RowLayout {
|
||||
Controls.CheckBox {
|
||||
id: borderSizeAutoCheckbox
|
||||
// Let it elide but don't make it push the ComboBox away from it
|
||||
ColumnLayout {
|
||||
anchors.fill: parent
|
||||
|
||||
Themes {
|
||||
id: themes
|
||||
Layout.fillWidth: true
|
||||
Layout.maximumWidth: implicitWidth
|
||||
text: i18nc("checkbox label", "Use theme's default window border size")
|
||||
enabled: !kcm.settings.isImmutable("borderSizeAuto")
|
||||
checked: kcm.settings.borderSizeAuto
|
||||
onToggled: {
|
||||
kcm.settings.borderSizeAuto = checked;
|
||||
borderSizeComboBox.autoBorderUpdate()
|
||||
}
|
||||
Layout.fillHeight: true
|
||||
}
|
||||
Controls.ComboBox {
|
||||
id: borderSizeComboBox
|
||||
enabled: !borderSizeAutoCheckbox.checked && !kcm.settings.isImmutable("borderSize")
|
||||
model: kcm.borderSizesModel
|
||||
currentIndex: kcm.borderSize
|
||||
onActivated: {
|
||||
kcm.borderSize = currentIndex
|
||||
|
||||
RowLayout {
|
||||
Controls.CheckBox {
|
||||
id: borderSizeAutoCheckbox
|
||||
// Let it elide but don't make it push the ComboBox away from it
|
||||
Layout.fillWidth: true
|
||||
Layout.maximumWidth: implicitWidth
|
||||
text: i18nc("checkbox label", "Use theme's default window border size")
|
||||
checked: kcm.settings.borderSizeAuto
|
||||
onToggled: {
|
||||
kcm.settings.borderSizeAuto = checked;
|
||||
borderSizeComboBox.autoBorderUpdate()
|
||||
}
|
||||
|
||||
KCM.SettingStateBinding {
|
||||
configObject: kcm.settings
|
||||
settingName: "borderSizeAuto"
|
||||
}
|
||||
|
||||
}
|
||||
function autoBorderUpdate() {
|
||||
if (borderSizeAutoCheckbox.checked) {
|
||||
kcm.borderSize = kcm.recommendedBorderSize
|
||||
Controls.ComboBox {
|
||||
id: borderSizeComboBox
|
||||
model: kcm.borderSizesModel
|
||||
currentIndex: kcm.borderSize
|
||||
onActivated: {
|
||||
kcm.borderSize = currentIndex
|
||||
}
|
||||
|
||||
KCM.SettingStateBinding {
|
||||
configObject: kcm.settings
|
||||
settingName: "borderSize"
|
||||
extraEnabledConditions: !borderSizeAutoCheckbox.checked
|
||||
}
|
||||
|
||||
function autoBorderUpdate() {
|
||||
if (borderSizeAutoCheckbox.checked) {
|
||||
kcm.borderSize = kcm.recommendedBorderSize
|
||||
}
|
||||
}
|
||||
|
||||
Connections {
|
||||
target: kcm
|
||||
onThemeChanged: borderSizeComboBox.autoBorderUpdate()
|
||||
}
|
||||
}
|
||||
|
||||
Connections {
|
||||
target: kcm
|
||||
onThemeChanged: borderSizeComboBox.autoBorderUpdate()
|
||||
Item {
|
||||
Layout.fillWidth: true
|
||||
}
|
||||
Controls.Button {
|
||||
text: i18nc("button text", "Get New Window Decorations...")
|
||||
icon.name: "get-hot-new-stuff"
|
||||
onClicked: kcm.getNewStuff(this)
|
||||
visible: KAuthorized.authorize("ghns")
|
||||
}
|
||||
}
|
||||
Item {
|
||||
Layout.fillWidth: true
|
||||
}
|
||||
Controls.Button {
|
||||
text: i18nc("button text", "Get New Window Decorations...")
|
||||
icon.name: "get-hot-new-stuff"
|
||||
onClicked: kcm.getNewStuff(this)
|
||||
visible: KAuthorized.authorize("ghns")
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -118,18 +141,21 @@ Kirigami.Page {
|
|||
Buttons {
|
||||
Layout.fillWidth: true
|
||||
Layout.fillHeight: true
|
||||
enabled: !kcm.settings.isImmutable("buttonsOnLeft") && !kcm.settings.isImmutable("buttonsOnRight")
|
||||
}
|
||||
|
||||
Controls.CheckBox {
|
||||
id: closeOnDoubleClickOnMenuCheckBox
|
||||
text: i18nc("checkbox label", "Close windows by double clicking the menu button")
|
||||
enabled: !kcm.settings.isImmutable("closeOnDoubleClickOnMenu")
|
||||
checked: kcm.settings.closeOnDoubleClickOnMenu
|
||||
onToggled: {
|
||||
kcm.settings.closeOnDoubleClickOnMenu = checked
|
||||
infoLabel.visible = checked
|
||||
}
|
||||
|
||||
KCM.SettingStateBinding {
|
||||
configObject: kcm.settings
|
||||
settingName: "closeOnDoubleClickOnMenu"
|
||||
}
|
||||
}
|
||||
|
||||
Kirigami.InlineMessage {
|
||||
|
@ -144,9 +170,13 @@ Kirigami.Page {
|
|||
Controls.CheckBox {
|
||||
id: showToolTipsCheckBox
|
||||
text: i18nc("checkbox label", "Show titlebar button tooltips")
|
||||
enabled: !kcm.settings.isImmutable("showToolTips")
|
||||
checked: kcm.settings.showToolTips
|
||||
onToggled: kcm.settings.showToolTips = checked
|
||||
|
||||
KCM.SettingStateBinding {
|
||||
configObject: kcm.settings
|
||||
settingName: "showToolTips"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -27,7 +27,7 @@ Name[da]=Vinduesdekorationer
|
|||
Name[de]=Fensterdekoration
|
||||
Name[el]=Διακοσμήσεις παραθύρου
|
||||
Name[en_GB]=Window Decorations
|
||||
Name[es]=Decoración de ventanas
|
||||
Name[es]=Decoraciones de las ventanas
|
||||
Name[et]=Akna dekoratsioonid
|
||||
Name[eu]=Leiho-apaindurak
|
||||
Name[fi]=Ikkunakehykset
|
||||
|
@ -99,6 +99,7 @@ Comment[nn]=Set opp tittellinjer og vindaugsrammer
|
|||
Comment[pl]=Ustawienia pasków tytułów i obramowań okien
|
||||
Comment[pt]=Configurar as barras de título e contornos das janelas
|
||||
Comment[pt_BR]=Configure as barras de títulos e bordas da janela
|
||||
Comment[ro]=Configurează barele de titlu și contururile ferestrelor
|
||||
Comment[ru]=Настройка заголовка и границ окон
|
||||
Comment[sk]=Nastaviť záhlavia a okraje okna
|
||||
Comment[sl]=Nastavi naslovne vrstice in robove oken
|
||||
|
|
|
@ -11,7 +11,7 @@ Name[da]=Vinduesdekorationer
|
|||
Name[de]=Fensterdekoration
|
||||
Name[el]=Διακοσμήσεις παραθύρου
|
||||
Name[en_GB]=Window Decorations
|
||||
Name[es]=Decoración de ventanas
|
||||
Name[es]=Decoraciones de las ventanas
|
||||
Name[et]=Akna dekoratsioonid
|
||||
Name[eu]=Leiho-apaindurak
|
||||
Name[fi]=Ikkunakehykset
|
||||
|
|
|
@ -98,6 +98,7 @@ Comment[nn]=Set opp navigering, nummer og vising av virtuelle skrivebord
|
|||
Comment[pl]=Ustawienia poruszania się, liczby oraz układu wirtualnych klawiatur
|
||||
Comment[pt]=Configura a navegação, número e disposição dos ecrãs virtuais
|
||||
Comment[pt_BR]=Configura a navegação, quantidade e layout das áreas de trabalho virtuais
|
||||
Comment[ro]=Configurează navigarea, numărul și aranjamentul birourilor virtuale
|
||||
Comment[ru]=Число, расположение и способ переключения рабочих столов
|
||||
Comment[sk]=Nastaviť navigáciu, počet a rozloženie virtuálnych plôch
|
||||
Comment[sl]=Nastavi krmarjenje, število in razporeditev navideznih namizij
|
||||
|
@ -137,6 +138,7 @@ X-KDE-Keywords[pa]=ਡੈਸਕਟਾਪ,ਗਿਣਤੀ,ਨੰਬਰ,ਅੰਕ,
|
|||
X-KDE-Keywords[pl]=pulpit,pulpity,liczba,pulpity wirtualne,wiele pulpitów
|
||||
X-KDE-Keywords[pt]=ecrã,ecrãs,número,ecrã virtual,múltiplos ecrãs,paginador,elemento paginador,'applet' do paginador,configuração do paginador
|
||||
X-KDE-Keywords[pt_BR]=área de trabalho,áreas de trabalho,desktop,desktops,número,área de trabalho virtual,múltiplas áreas de trabalho,paginador,elemento paginador,miniaplicativo do paginador,configurações do paginador
|
||||
X-KDE-Keywords[ro]=birou,birouri,număr,birou virtual,birouri multiple,paginator,control paginator,miniaplicație paginator,configurare paginator,paginare
|
||||
X-KDE-Keywords[ru]=desktop,desktops,number,virtual desktop,multiple desktops,pager,pager widget,pager applet,pager settings,рабочий стол,рабочие столы,число,виртуальный рабочий стол,несколько рабочих столов,переключатель,переключение,виджет переключения,аплет переключения,параметры переключения,настройки переключения
|
||||
X-KDE-Keywords[sk]=plocha,plochy,číslo,virtuálna plocha,viac plôch,pager,widget pagera,applet pagera,nastavenia pagera
|
||||
X-KDE-Keywords[sl]=namizje,namizja,število namizij,navidezna namizja,več namizij,pozivnik
|
||||
|
|
|
@ -85,6 +85,7 @@ Comment[nn]=Set opp navigering, nummer og vising av virtuelle skrivebord
|
|||
Comment[pl]=Ustawienia poruszania się, liczby oraz układu wirtualnych klawiatur
|
||||
Comment[pt]=Configura a navegação, número e disposição dos ecrãs virtuais
|
||||
Comment[pt_BR]=Configura a navegação, quantidade e layout das áreas de trabalho virtuais
|
||||
Comment[ro]=Configurează navigarea, numărul și aranjamentul birourilor virtuale
|
||||
Comment[ru]=Число, расположение и способ переключения рабочих столов
|
||||
Comment[sk]=Nastaviť navigáciu, počet a rozloženie virtuálnych plôch
|
||||
Comment[sl]=Nastavi krmarjenje, število in razporeditev navideznih namizij
|
||||
|
|
|
@ -85,6 +85,7 @@ Comment[nn]=Samansetjarinnstillingar for skrivebordseffektar
|
|||
Comment[pl]=Ustawienia kompozytora dla efektów pulpitu
|
||||
Comment[pt]=Configuração do compositor para os efeitos do ecrã
|
||||
Comment[pt_BR]=Defina as configurações do compositor para os efeitos da área de trabalho
|
||||
Comment[ro]=Configurează opțiunile compozitorului pentru efecte de birou
|
||||
Comment[ru]=Настройка движка эффектов рабочего стола
|
||||
Comment[sk]=Nastavenia kompozítora pre efekty plochy
|
||||
Comment[sl]=Nastavitve upravljalnika skladnje za učinke namizja
|
||||
|
|
|
@ -27,6 +27,7 @@ Name[pa]=ਵਿੰਡੋ ਮੈਨੇਜਰ ਪਰਭਾਵ
|
|||
Name[pl]=Efekty zarządzania oknami
|
||||
Name[pt]=Efeitos do Gestor de Janelas
|
||||
Name[pt_BR]=Efeitos do gerenciador de janelas
|
||||
Name[ro]=Efectele gestionarului de ferestre
|
||||
Name[ru]=Эффекты диспетчера окон KWin
|
||||
Name[sk]=Efekty správcu okien
|
||||
Name[sl]=Učinki upravljalnika oken
|
||||
|
|
|
@ -32,6 +32,7 @@ Name[nn]=Handlingar for vindauge
|
|||
Name[pl]=Zachowanie okien
|
||||
Name[pt]=Acções das Janelas
|
||||
Name[pt_BR]=Ações da janela
|
||||
Name[ro]=Acțiuni fereastră
|
||||
Name[ru]=Действия с окнами
|
||||
Name[sk]=Akcie okna
|
||||
Name[sl]=Dejavnosti oken
|
||||
|
@ -64,6 +65,7 @@ Comment[nn]=Set opp musehandlingar for vindauge og tittellinjer
|
|||
Comment[pl]=Ustawienia działań myszy dla okien i pasków tytułu
|
||||
Comment[pt]=Configurar as acções do rato para as janelas e barras do título
|
||||
Comment[pt_BR]=Configura as ações do mouse para as janelas e barras de títulos
|
||||
Comment[ro]=Configurează acțiunile mausului pentru ferestre și bare de titlu
|
||||
Comment[ru]=Настройка действий для окон и их заголовков
|
||||
Comment[sk]=Nastavenie akcií myši pre okná a záhlavia
|
||||
Comment[sl]=Nastavi aktivnosti miške za okna in naslovne vrstice
|
||||
|
@ -104,6 +106,7 @@ X-KDE-Keywords[nn]=rull,fald saman,fald ut,samanfalding,maksimer,minimer,senk,ha
|
|||
X-KDE-Keywords[pl]=zwiń,maksymalizuj,minimalizuj,obniż,operacje na menu,pasek tytułu,zmień rozmiar
|
||||
X-KDE-Keywords[pt]=enrolar,maximizar,minimizar,baixar,menu de operações,barra de título,dimensionar
|
||||
X-KDE-Keywords[pt_BR]=enrolar,maximizar,minimizar,baixar,menu de operações,barra de título,redimensionar
|
||||
X-KDE-Keywords[ro]=strânge,maximizează,minimizează,coboară,meniu operații,bară de titlu,redimensionează
|
||||
X-KDE-Keywords[ru]=shade,maximise,maximize,minimize,minimise,lower,operations menu,titlebar,resize,свернуть,распахнуть,убрать вниз,меню операций,меню действий,заголовок окна,заголовок,изменить размер
|
||||
X-KDE-Keywords[sk]=tieň,maximalizácia,maximalizovanie,minimalizácia,minimalizovanie,nižší,ponuka operácií,záhlavie,zmeniť veľkosť
|
||||
X-KDE-Keywords[sl]=zvij,povečaj,razpni,pomanjšaj,skrči,dvigni,spusti,naslovna vrstica,spremeni velikost,okenski meni,meni okna
|
||||
|
|
|
@ -31,6 +31,7 @@ Name[nn]=Avansert vindaugsåtferd
|
|||
Name[pl]=Zaawansowane zachowania okien
|
||||
Name[pt]=Comportamento Avançado das Janelas
|
||||
Name[pt_BR]=Comportamento avançado das janelas
|
||||
Name[ro]=Comportament avansat al ferestrelor
|
||||
Name[ru]=Расширенное поведение окон
|
||||
Name[sk]=Pokročilé správanie okien
|
||||
Name[sl]=Napredno obnašanje oken
|
||||
|
@ -63,6 +64,7 @@ Comment[nn]=Set opp avanserte vindaugshandsamarinnstillingar
|
|||
Comment[pl]=Zaawansowane ustawienia zarządzania oknami
|
||||
Comment[pt]=Configurar as funcionalidades de gestão de janelas avançadas
|
||||
Comment[pt_BR]=Configure as opções avançadas de gerenciamento de janelas
|
||||
Comment[ro]=Configurează opțiuni avansate de gestiune a ferestrelor
|
||||
Comment[ru]=Настройка дополнительных возможностей управления окнами
|
||||
Comment[sk]=Nastaviť pokročilé možnosti správy okien
|
||||
Comment[sl]=Nastavi napredne zmožnosti upravljanja oken
|
||||
|
|
|
@ -30,6 +30,7 @@ Name[nn]=Fokusåtferd for vindauge
|
|||
Name[pl]=Zachowanie uaktywnienia okien
|
||||
Name[pt]=Comportamento do Foco da Janela
|
||||
Name[pt_BR]=Comportamento do foco da janela
|
||||
Name[ro]=Comportament focalizare ferestre
|
||||
Name[ru]=Фокус окон
|
||||
Name[sk]=Správanie zamerania okien
|
||||
Name[sl]=Obnašanje oken pri osredotočanju
|
||||
|
@ -61,6 +62,7 @@ Comment[nn]=Set opp praksisen for vindaugsaktivering
|
|||
Comment[pl]=Ustawienia uaktywniania okien
|
||||
Comment[pt]=Configurar a política de activação da janela
|
||||
Comment[pt_BR]=Configure a política de ativação de janela
|
||||
Comment[ro]=Configurează politica de activare a ferestrelor
|
||||
Comment[ru]=Настройка активации окон
|
||||
Comment[sk]=Nastavenie spôsobu aktivácie okien
|
||||
Comment[sl]=Nastavi politiko aktiviranja okna
|
||||
|
|
|
@ -31,6 +31,7 @@ Name[nn]=Vidaugsflytting
|
|||
Name[pl]=Przesuwanie okien
|
||||
Name[pt]=Movimentação das Janelas
|
||||
Name[pt_BR]=Movimento da janela
|
||||
Name[ro]=Mutare ferestre
|
||||
Name[ru]=Перемещение окон
|
||||
Name[sk]=Presuny okien
|
||||
Name[sl]=Premikanje oken
|
||||
|
@ -62,6 +63,7 @@ Comment[nn]=Set opp vindaugsflytting
|
|||
Comment[pl]=Ustawienia opcji przesuwania okien
|
||||
Comment[pt]=Configurar as opções de movimentação das janelas
|
||||
Comment[pt_BR]=Configure as opções de movimento da janela
|
||||
Comment[ro]=Configurează opțiuni de mutare a ferestrelor
|
||||
Comment[ru]=Настройка поведения при перемещении окон
|
||||
Comment[sk]=Nastavenie spôsobu presunu okien
|
||||
Comment[sl]=Nastavi možnosti premikanja okna
|
||||
|
@ -101,6 +103,7 @@ X-KDE-Keywords[nn]=flytting,smart,kaskade,maksimering,gripesone,gripa,kant
|
|||
X-KDE-Keywords[pl]=przesuwanie,elegancki,kaskada,maksymalizuj,obszar przyciągania,przyciągaj,obramowanie
|
||||
X-KDE-Keywords[pt]=movimento,inteligente,cascata,maximizar,ajuste à zona,ajuste,contorno
|
||||
X-KDE-Keywords[pt_BR]=movimento,movimentação,inteligente,cascata,maximizar,ajuste à área,ajuste,borda
|
||||
X-KDE-Keywords[ro]=mutare,inteligent,cascadă,maximizează,minimizează,zonă magnetică,magnet,contur
|
||||
X-KDE-Keywords[ru]=moving,smart,cascade,maximize,maximise,snap zone,snap,border,перемещение,каскад,распахнуть,свернуть,захват,привязка,граница
|
||||
X-KDE-Keywords[sk]=presun,smart,kaskáda,maximalizácia,miinmalizácia,oblasť prichytenia,prichytenie,rám
|
||||
X-KDE-Keywords[sl]=premikanje,pametno premikanje,kaskada,povečaj,razpni,območje pripenjanja,pripenjanje,rob,robovi,obroba,obrobe
|
||||
|
|
|
@ -74,7 +74,7 @@ Name[pa]=ਵਿੰਡੋ ਰਵੱਈਆ
|
|||
Name[pl]=Zachowania okien
|
||||
Name[pt]=Comportamento das Janelas
|
||||
Name[pt_BR]=Comportamento das janelas
|
||||
Name[ro]=Comportament fereastră
|
||||
Name[ro]=Comportament ferestre
|
||||
Name[ru]=Поведение окон
|
||||
Name[se]=Láseláhtten
|
||||
Name[si]=කවුළු හැසිරීම
|
||||
|
@ -123,6 +123,7 @@ Comment[nn]=Set opp utsjånad og åtferd for vindauge
|
|||
Comment[pl]=Ustawienia działań i zachowań okien
|
||||
Comment[pt]=Configurar as acções e comportamento das janelas
|
||||
Comment[pt_BR]=Configure as ações e comportamento das janelas
|
||||
Comment[ro]=Configurează acțiunile și comportamentul ferestrelor
|
||||
Comment[ru]=Настройка поведения окон
|
||||
Comment[sk]=Nastaviť akcie a správanie okien
|
||||
Comment[sl]=Nastavi dejanja in obnašanje oken
|
||||
|
@ -160,6 +161,7 @@ X-KDE-Keywords[nn]=fokus,plassering,vindaugsåtferd,vindaugshandlingar,animering
|
|||
X-KDE-Keywords[pl]=uaktywnienie,umieszczenie,zachowanie okna,działania okien,animacja,wzniesienie,auto-wzniesienie, okna,ramka,pasek tytułu,podwójne kliknięcie
|
||||
X-KDE-Keywords[pt]=foco,colocação,comportamento da janela,acções das janelas,animação,elevar,elevar automaticamente,janelas,contorno,barra de título,duplo-click
|
||||
X-KDE-Keywords[pt_BR]=foco,colocação,comportamento da janela,ações da janela,animação,elevar,elevar automaticamente,janelas,contorno,barra de título,clique duplo
|
||||
X-KDE-Keywords[ro]=focalizare,amplasare,comportament ferestre,acțiuni ferestre,animație,ridică,ridicare automată,ferestre,cadru,bară de titlu,dublu clic
|
||||
X-KDE-Keywords[ru]=focus,placement,window behavior,window actions,animation,raise,auto raise,windows,frame,titlebar,doubleclick,фокус,местоположение,поведение окон,анимация,увеличение,автоувеличение,окна,рамка,заголовок,двойной щелчок,действия над окнами
|
||||
X-KDE-Keywords[sk]=zameranie,umiestnenie,správanie okien,animácia,zdvihnúť,automaticky zdvihnúť,okná,rám,záhlavie,dvojklik
|
||||
X-KDE-Keywords[sl]=fokus,žarišče,postavitev,postavljanje,obnašanje oken,dejanja oken,animacija,dvig,samodejni dvig,okna,okvir,naslovna vrstica,dvojni klik,dvoklik
|
||||
|
|
|
@ -39,6 +39,11 @@
|
|||
#define FOCUS_UNDER_MOUSE 4
|
||||
#define FOCUS_STRICTLY_UNDER_MOUSE 5
|
||||
|
||||
namespace
|
||||
{
|
||||
constexpr int defaultFocusPolicyIndex = CLICK_TO_FOCUS;
|
||||
}
|
||||
|
||||
KWinFocusConfigForm::KWinFocusConfigForm(QWidget* parent)
|
||||
: QWidget(parent)
|
||||
{
|
||||
|
@ -60,6 +65,8 @@ void KFocusConfig::initialize(KWinOptionsSettings *settings)
|
|||
addConfig(m_settings, this);
|
||||
|
||||
connect(m_ui->windowFocusPolicy, qOverload<int>(&QComboBox::currentIndexChanged), this, &KFocusConfig::focusPolicyChanged);
|
||||
connect(m_ui->windowFocusPolicy, qOverload<int>(&QComboBox::currentIndexChanged), this, &KFocusConfig::updateDefaultIndicator);
|
||||
connect(this, SIGNAL(defaultsIndicatorsVisibleChanged(bool)), this, SLOT(updateDefaultIndicator()));
|
||||
|
||||
connect(qApp, &QGuiApplication::screenAdded, this, &KFocusConfig::updateMultiScreen);
|
||||
connect(qApp, &QGuiApplication::screenRemoved, this, &KFocusConfig::updateMultiScreen);
|
||||
|
@ -75,6 +82,13 @@ void KFocusConfig::updateMultiScreen()
|
|||
m_ui->kcfg_SeparateScreenFocus->setVisible(QApplication::screens().count() > 1);
|
||||
}
|
||||
|
||||
void KFocusConfig::updateDefaultIndicator()
|
||||
{
|
||||
const bool isDefault = m_ui->windowFocusPolicy->currentIndex() == defaultFocusPolicyIndex;
|
||||
m_ui->windowFocusPolicy->setProperty("_kde_highlight_neutral", defaultsIndicatorsVisible() && !isDefault);
|
||||
m_ui->windowFocusPolicy->update();
|
||||
}
|
||||
|
||||
void KFocusConfig::focusPolicyChanged()
|
||||
{
|
||||
int selectedFocusPolicy = 0;
|
||||
|
@ -115,7 +129,7 @@ void KFocusConfig::focusPolicyChanged()
|
|||
unmanagedWidgetChangeState(changed);
|
||||
emit unmanagedWidgetStateChanged(changed);
|
||||
|
||||
const bool isDefault = focusPolicy == CLICK_TO_FOCUS;
|
||||
const bool isDefault = focusPolicy == defaultFocusPolicyIndex;
|
||||
unmanagedWidgetDefaultState(isDefault);
|
||||
emit unmanagedWidgetDefaulted(isDefault);
|
||||
|
||||
|
@ -206,7 +220,7 @@ void KFocusConfig::save(void)
|
|||
void KFocusConfig::defaults()
|
||||
{
|
||||
KCModule::defaults();
|
||||
m_ui->windowFocusPolicy->setCurrentIndex(CLICK_TO_FOCUS);
|
||||
m_ui->windowFocusPolicy->setCurrentIndex(defaultFocusPolicyIndex);
|
||||
}
|
||||
|
||||
KWinAdvancedConfigForm::KWinAdvancedConfigForm(QWidget* parent)
|
||||
|
|
|
@ -77,6 +77,7 @@ protected:
|
|||
private Q_SLOTS:
|
||||
void focusPolicyChanged();
|
||||
void updateMultiScreen();
|
||||
void updateDefaultIndicator();
|
||||
|
||||
private:
|
||||
|
||||
|
|
|
@ -56,7 +56,7 @@ Name[pa]=ਵਿੰਡੋ ਨਿਯਮ
|
|||
Name[pl]=Zasady okien
|
||||
Name[pt]=Regras das Janelas
|
||||
Name[pt_BR]=Regras das janelas
|
||||
Name[ro]=Reguli fereastră
|
||||
Name[ro]=Reguli ferestre
|
||||
Name[ru]=Особые параметры окон
|
||||
Name[si]=කවුළු නීති
|
||||
Name[sk]=Pravidlá okien
|
||||
|
@ -107,6 +107,7 @@ Comment[pa]=ਵੱਖ-ਵੱਖ ਵਿੰਡੋ ਰਵੱਈਆ
|
|||
Comment[pl]=Wyjątkowe okna
|
||||
Comment[pt]=Comportamento das Janelas Individuais
|
||||
Comment[pt_BR]=Comportamento das janelas individuais
|
||||
Comment[ro]=Comportament al ferestrelor individuale
|
||||
Comment[ru]=Особые параметры конкретных окон
|
||||
Comment[sk]=Individuálne správanie okien
|
||||
Comment[sl]=Obnašanje posameznih oken
|
||||
|
@ -152,6 +153,7 @@ X-KDE-Keywords[nn]=storleik,plassering,tilstand,vindaugsåtferd,vindauge,einskil
|
|||
X-KDE-Keywords[pl]=rozmiar,pozycja,stan,zachowanie okna,okna,specyficzne,obejścia,zapamiętaj,reguły
|
||||
X-KDE-Keywords[pt]=tamanho,posição,estado,comportamento da janela,janelas,específico,alternativas,recordar,regras
|
||||
X-KDE-Keywords[pt_BR]=tamanho,posição,estado,comportamento da janela,janelas,específico,alternativas,lembrar,regras
|
||||
X-KDE-Keywords[ro]=dimensiune,poziție,stare,comportament ferestre,ferestre,specific,ține minte,reguli
|
||||
X-KDE-Keywords[ru]=size,position,state,window behavior,windows,specific,workarounds,remember,rules,размер,позиция,состояние,поведение окон,окна,специальный,специальные возможности,запомнить,правила
|
||||
X-KDE-Keywords[sk]=veľkosť,poloha,stav,správanie okien,okná,špecifický,workaroundy,pamätať,pravidlá
|
||||
X-KDE-Keywords[sl]=velikost,položaj,stanje,obnašanje oken,okna,določeno,popravki,pomnjenje,pravila
|
||||
|
|
|
@ -190,6 +190,9 @@ static void edit(const QVariantMap &data, bool whole_app)
|
|||
int main(int argc, char* argv[])
|
||||
{
|
||||
QApplication app(argc, argv);
|
||||
|
||||
KLocalizedString::setApplicationDomain("kcm_kwinrules");
|
||||
|
||||
app.setAttribute(Qt::AA_UseHighDpiPixmaps, true);
|
||||
app.setApplicationDisplayName(i18n("KWin"));
|
||||
app.setApplicationName("kwin_rules_dialog");
|
||||
|
|
|
@ -54,7 +54,6 @@ ScrollViewKCM {
|
|||
}
|
||||
}
|
||||
|
||||
// FIXME: InlineMessage.qml:241:13: QML Label: Binding loop detected for property "verticalAlignment"
|
||||
header: Kirigami.InlineMessage {
|
||||
Layout.fillWidth: true
|
||||
Layout.fillHeight: true
|
||||
|
@ -99,7 +98,7 @@ ScrollViewKCM {
|
|||
|
||||
Connections {
|
||||
target: rulesModel
|
||||
onSuggestionsChanged: {
|
||||
function onSuggestionsChanged() {
|
||||
propertySheet.sheetOpen = true;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -26,7 +26,7 @@ ScrollViewKCM {
|
|||
// Manage KCM pages
|
||||
Connections {
|
||||
target: kcm
|
||||
onEditIndexChanged: {
|
||||
function onEditIndexChanged() {
|
||||
if (kcm.editIndex < 0) {
|
||||
// If no rule is being edited, hide RulesEdidor page
|
||||
kcm.pop();
|
||||
|
|
|
@ -59,7 +59,7 @@ Name[pa]=ਵਿੰਡੋ ਨਿਯਮ
|
|||
Name[pl]=Zasady okien
|
||||
Name[pt]=Regras das Janelas
|
||||
Name[pt_BR]=Regras das janelas
|
||||
Name[ro]=Reguli fereastră
|
||||
Name[ro]=Reguli ferestre
|
||||
Name[ru]=Особые параметры окон
|
||||
Name[si]=කවුළු නීති
|
||||
Name[sk]=Pravidlá okien
|
||||
|
@ -109,6 +109,7 @@ Comment[pa]=ਵੱਖ-ਵੱਖ ਵਿੰਡੋ ਰਵੱਈਆ
|
|||
Comment[pl]=Wyjątkowe okna
|
||||
Comment[pt]=Comportamento das Janelas Individuais
|
||||
Comment[pt_BR]=Comportamento das janelas individuais
|
||||
Comment[ro]=Comportament al ferestrelor individuale
|
||||
Comment[ru]=Особые параметры конкретных окон
|
||||
Comment[sk]=Individuálne správanie okien
|
||||
Comment[sl]=Obnašanje posameznih oken
|
||||
|
|
|
@ -42,8 +42,8 @@ RulesDialog::RulesDialog(QWidget* parent, const char* name)
|
|||
layout()->addWidget(m_quickWidget);
|
||||
|
||||
QDialogButtonBox *buttons = new QDialogButtonBox(QDialogButtonBox::Ok | QDialogButtonBox::Cancel, this);
|
||||
connect(buttons, SIGNAL(accepted()), SLOT(accept()));
|
||||
connect(buttons, SIGNAL(rejected()), SLOT(reject()));
|
||||
connect(buttons, &QDialogButtonBox::accepted, this, &QDialog::accept);
|
||||
connect(buttons, &QDialogButtonBox::rejected, this, &QDialog::reject);
|
||||
layout()->addWidget(buttons);
|
||||
}
|
||||
|
||||
|
|
|
@ -48,7 +48,7 @@ public:
|
|||
// reset to default settings and assess for saveNeeded and default changed
|
||||
virtual void setDefaults();
|
||||
|
||||
private Q_SLOTS:
|
||||
public Q_SLOTS:
|
||||
void onChanged();
|
||||
void createConnection();
|
||||
|
||||
|
|
|
@ -20,14 +20,15 @@ KWinScreenEdgesConfigForm::KWinScreenEdgesConfigForm(QWidget *parent)
|
|||
{
|
||||
ui->setupUi(this);
|
||||
|
||||
connect(ui->kcfg_ElectricBorderDelay, SIGNAL(valueChanged(int)), this, SLOT(sanitizeCooldown()));
|
||||
connect(ui->kcfg_ElectricBorderDelay, qOverload<int>(&QSpinBox::valueChanged), this, &KWinScreenEdgesConfigForm::sanitizeCooldown);
|
||||
|
||||
// Visual feedback of action group conflicts
|
||||
connect(ui->kcfg_ElectricBorders, SIGNAL(currentIndexChanged(int)), this, SLOT(groupChanged()));
|
||||
connect(ui->kcfg_ElectricBorderMaximize, SIGNAL(stateChanged(int)), this, SLOT(groupChanged()));
|
||||
connect(ui->kcfg_ElectricBorderTiling, SIGNAL(stateChanged(int)), this, SLOT(groupChanged()));
|
||||
connect(ui->kcfg_ElectricBorders, qOverload<int>(&QComboBox::currentIndexChanged), this, &KWinScreenEdgesConfigForm::groupChanged);
|
||||
connect(ui->kcfg_ElectricBorderMaximize, &QCheckBox::stateChanged, this, &KWinScreenEdgesConfigForm::groupChanged);
|
||||
connect(ui->kcfg_ElectricBorderTiling, &QCheckBox::stateChanged, this, &KWinScreenEdgesConfigForm::groupChanged);
|
||||
|
||||
connect(ui->electricBorderCornerRatioSpin, SIGNAL(valueChanged(int)), this, SLOT(onChanged()));
|
||||
connect(ui->electricBorderCornerRatioSpin, qOverload<int>(&QSpinBox::valueChanged), this, &KWinScreenEdgesConfigForm::onChanged);
|
||||
connect(ui->electricBorderCornerRatioSpin, qOverload<int>(&QSpinBox::valueChanged), this, &KWinScreenEdgesConfigForm::updateDefaultIndicators);
|
||||
}
|
||||
|
||||
KWinScreenEdgesConfigForm::~KWinScreenEdgesConfigForm()
|
||||
|
@ -53,7 +54,7 @@ double KWinScreenEdgesConfigForm::electricBorderCornerRatio() const
|
|||
|
||||
void KWinScreenEdgesConfigForm::setElectricBorderCornerRatioEnabled(bool enable)
|
||||
{
|
||||
return ui->electricBorderCornerRatioSpin->setEnabled(enable);
|
||||
ui->electricBorderCornerRatioSpin->setEnabled(enable);
|
||||
}
|
||||
|
||||
void KWinScreenEdgesConfigForm::reload()
|
||||
|
@ -68,6 +69,14 @@ void KWinScreenEdgesConfigForm::setDefaults()
|
|||
KWinScreenEdge::setDefaults();
|
||||
}
|
||||
|
||||
void KWinScreenEdgesConfigForm::setDefaultsIndicatorsVisible(bool visible)
|
||||
{
|
||||
if (m_defaultIndicatorVisible != visible) {
|
||||
m_defaultIndicatorVisible = visible;
|
||||
updateDefaultIndicators();
|
||||
}
|
||||
}
|
||||
|
||||
Monitor *KWinScreenEdgesConfigForm::monitor() const
|
||||
{
|
||||
return ui->monitor;
|
||||
|
@ -101,4 +110,10 @@ void KWinScreenEdgesConfigForm::groupChanged()
|
|||
monitorHideEdge(ElectricLeft, hide);
|
||||
}
|
||||
|
||||
void KWinScreenEdgesConfigForm::updateDefaultIndicators()
|
||||
{
|
||||
ui->electricBorderCornerRatioSpin->setProperty("_kde_highlight_neutral", m_defaultIndicatorVisible && (electricBorderCornerRatio() != m_defaultCornerRatio));
|
||||
ui->electricBorderCornerRatioSpin->update();
|
||||
}
|
||||
|
||||
} // namespace
|
||||
|
|
|
@ -41,6 +41,9 @@ public:
|
|||
void reload() override;
|
||||
void setDefaults() override;
|
||||
|
||||
public Q_SLOTS:
|
||||
void setDefaultsIndicatorsVisible(bool visible);
|
||||
|
||||
protected:
|
||||
Monitor *monitor() const override;
|
||||
bool isSaveNeeded() const override;
|
||||
|
@ -49,12 +52,15 @@ protected:
|
|||
private Q_SLOTS:
|
||||
void sanitizeCooldown();
|
||||
void groupChanged();
|
||||
void updateDefaultIndicators();
|
||||
|
||||
private:
|
||||
// electricBorderCornerRatio value between 0. and 1.
|
||||
double m_referenceCornerRatio = 0.;
|
||||
double m_defaultCornerRatio = 0.;
|
||||
|
||||
bool m_defaultIndicatorVisible = false;
|
||||
|
||||
Ui::KWinScreenEdgesConfigUI *ui;
|
||||
};
|
||||
|
||||
|
|
|
@ -61,7 +61,7 @@ Name[pa]=ਸਕਰੀਨ ਬਾਹੀਆਂ
|
|||
Name[pl]=Krawędzie ekranu
|
||||
Name[pt]=Extremos do Ecrã
|
||||
Name[pt_BR]=Contornos da tela
|
||||
Name[ro]=Muchiile ecranului
|
||||
Name[ro]=Marginile ecranului
|
||||
Name[ru]=Края экрана
|
||||
Name[si]=තිර මුළු
|
||||
Name[sk]=Okraje obrazovky
|
||||
|
@ -104,6 +104,7 @@ Comment[nn]=Set opp aktive skjermhjørne og skjermkantar
|
|||
Comment[pl]=Ustawienia czułych narożników i krawędzi ekranu
|
||||
Comment[pt]=Configurar os cantos e extremos do ecrã activo
|
||||
Comment[pt_BR]=Configura os cantos e bordas da tela ativa
|
||||
Comment[ro]=Configurează colțurile și marginile active ale ecranului
|
||||
Comment[ru]=Настройка действий для краёв и углов экрана
|
||||
Comment[sk]=Nastavenie aktívnych okrajov obrazovky a hrán
|
||||
Comment[sl]=Nastavi dejavne kote in robove okna
|
||||
|
|
|
@ -39,6 +39,7 @@ Name[pa]=ਟੱਚ ਸਕਰੀਨ
|
|||
Name[pl]=Ekran dotykowy
|
||||
Name[pt]=Ecrã Táctil
|
||||
Name[pt_BR]=Touch Screen
|
||||
Name[ro]=Ecran tactil
|
||||
Name[ru]=Сенсорный экран
|
||||
Name[sk]=Dotyková obrazovka
|
||||
Name[sl]=Zaslon na dotik
|
||||
|
@ -75,6 +76,7 @@ Comment[nn]=Set opp fingerrørsler på trykkskjerm
|
|||
Comment[pl]=Ustawienia gestów na ekranie dotykowym
|
||||
Comment[pt]=Configurar os gestos para deslizar o ecrã táctil
|
||||
Comment[pt_BR]=Configura os gestos na tela sensível ao toque
|
||||
Comment[ro]=Configurează gesturi de tragere pe ecran tactil
|
||||
Comment[ru]=Действия при проведении по сенсорному экрану
|
||||
Comment[sk]=Nastaviť ťahacie gestá dotykovej obrazovky
|
||||
Comment[sl]=Nastavi kretnje vlečenja za zaslon na dotik
|
||||
|
@ -108,6 +110,7 @@ X-KDE-Keywords[nn]=kwin,vindauge,handsamar,effekt,kant,ramme,handling,byte,skriv
|
|||
X-KDE-Keywords[pl]=kwin,okno,menadżer,efekt,krawędź,obramowanie,działanie,przełącz,pulpit,krawędzie pulpitu,krawędzie ekranu,strona ekranu,zachowanie ekranu,ekran dotykowy
|
||||
X-KDE-Keywords[pt]=kwin,janela,gestor,efeito,extremo,contorno,acção,mudar,ecrã,extremos do ecrã no kwin,extremos do ecrã,maximizar as janelas,janelas lado-a-lado,lado do ecrã,comportamento do ecrã,ecrã táctil
|
||||
X-KDE-Keywords[pt_BR]=kwin,janela,gerenciador,efeito,canto,contorno,borda,ação,mudar,área de trabalho,cantos da área de trabalho, desktop,lado da tela,comportamento da tela,touch screen
|
||||
X-KDE-Keywords[ro]=kwin,fereastră,gestionar,efect,margine,muchie,latură,acțiune,schimbă,birou,marginile biroului,marginile ecranului,marginea ecranului,comportament ecran,ecran tactil
|
||||
X-KDE-Keywords[ru]=kwin,window,manager,effect,corner,edge,border,action,switch,desktop,kwin screen edges,desktop edges,screen edges,maximize windows,tile windows,side of screen,screen behavior,switch desktop,virtual desktop,screen corners,окно,окон,диспетчер,эффект,край,граница,действие,переключить,рабочий стол,края экрана kwin,края экрана,края рабочего стола,распахнуть окна,мозаика окон,край экрана,поведение экрана,переключить рабочий стол,виртуальный рабочий стол,углы рабочего стола,углы экрана,тачскрин,сенсорный экран,touch screen
|
||||
X-KDE-Keywords[sk]=Kwin, okná, manažér, efekt, okraj, hranice, akcie, prepínač, desktop, okraje plochy,Okraje obrazovky, bočná strana obrazovky, správanie obrazovky, dotyková obrazovka
|
||||
X-KDE-Keywords[sl]=kwin,okno,upravljalnik oken,upravljanje oken,učinki,rob,obroba,dejanje,preklopi,preklapljanje,robovi namizja,robovi zaslona,rob zaslona,obnašanje zaslona,zaslon na dotik
|
||||
|
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue