Compare commits

...

83 Commits

Author SHA1 Message Date
Benjamin Port 5290583f8a KCM KWin Decoration: Remove isDefault
Custom code for isDefault is not needed. Indeed, testing dropdown value is not needed to know if we have a default value or not. Testing theme and border size auto is enough, and it's done automatically by KConfigXT
2020-10-07 10:14:07 +00:00
Méven Car a7aa089ec4 ScreenshotEffect: fix ordering of screens in screenshotScreens 2020-10-06 17:07:05 +02:00
l10n daemon script de4e429aed SVN_SILENT made messages (.desktop file) - always resolve ours
In case of conflict in i18n, keep the version of the branch "ours"
To resolve a particular conflict, "git checkout --ours path/to/file.desktop"
2020-10-06 06:04:18 +02:00
Xaver Hugl b50f747876 Multi-GPU output support on Wayland
This commit sets up udev and the DrmBackend to list and use all GPUs.

BUG: 425586
BUG: 417323
2020-10-05 21:05:55 +00:00
l10n daemon script 1f6e615ec0 SVN_SILENT made messages (.desktop file) - always resolve ours
In case of conflict in i18n, keep the version of the branch "ours"
To resolve a particular conflict, "git checkout --ours path/to/file.desktop"
2020-10-05 06:16:34 +02:00
Ismael Asensio 715f0dbbcc [kcm/kwinrules] Port to new Connections syntax
While at it remove `FIXME`comment that no longer applies
2020-10-02 23:19:59 +00:00
Andreas Hartmetz 9d77271011 Fix const / non-const iterator mismatch
Fixes the build for me. STL actually allows const and non-const
iterator comparsion, Qt containers... uh, sometimes? :>
2020-10-02 23:22:22 +02:00
Vlad Zahorodnii 0e7b02bc73 Export QDebug operator<<(QDebug , const Toplevel *)
It can be useful when debugging code in plugins, etc.
2020-10-02 13:44:10 +03:00
Vlad Zahorodnii 005377eff7 Unify code that setups client connections in EffectsHandlerImpl
Workspace::allClientList() returns all X11 and Wayland windows. So, we
don't need the two separate code paths.
2020-10-01 16:26:52 +00:00
Vlad Zahorodnii 0f9722ad69 Port DebugConsole to Workspace::allClientList()
This simplifies the code by porting the debug console away from
Workspace::clientList() to Workspace::allClientList(). The main
difference between the two is that the former returns only all X11
windows and the latter returns both X11 and Wayland windows.
2020-10-01 16:26:52 +00:00
David Edmundson 56f159dded Adapt to DataSource changes 2020-10-01 14:51:05 +00:00
Nicolas Fella 3694580e2b [kcms/effectmodel] Use KPluginMetaData to load scripted config
Instead of going through the semi-deprecated KPluginTrader and KPluginInfo we can use KPluginLoader directly.
2020-10-01 14:28:46 +00:00
Vlad Zahorodnii bf4c67678f 3rdparty: Synchronize xcursor.{c,h} 2020-10-01 13:54:45 +03:00
Vlad Zahorodnii 1e9bd43368 scripting: Fix initialization of WorkspaceWrapper
Workspace::clientList() only returns X11 clients, while allClientList()
returns all managed clients (both X11 and Wayland).
2020-10-01 10:20:31 +00:00
Vlad Zahorodnii 1251b2cbb3 scripting: Make ClientFilterModel work for Wayland windows 2020-10-01 10:20:31 +00:00
Vlad Zahorodnii faf6b8e049 scripting: Properly initialize clients model for Wayland windows
In some cases, a ClientLevel model may not contain all Wayland windows
because of missing if (waylandServer()) {} code path in init() method.
2020-10-01 10:20:31 +00:00
Cyril Rossi a3caf7f6dd Port KCM KWin Decoration to SettingStateBinding 2020-10-01 09:19:32 +02:00
Albert Astals Cid 743b06d3a1 Fix kwin_rules_dialog not showing translated strings
BUGS: 427172
2020-10-01 00:29:13 +02:00
Nicolas Fella abca052004 [kcm/decoration] Port to KPluginLoader
Summary: KPluginTrader's future is uncertain. KPluginLoader is enough here

Test Plan: Open deco KCM. Themes are listed

Reviewers: #kwin, dfaure

Reviewed By: dfaure

Subscribers: dfaure, zzag, kwin

Tags: #kwin

Maniphest Tasks: T12173

Differential Revision: https://phabricator.kde.org/D25534
2020-09-30 15:50:52 +02:00
Bhushan Shah 0a3e18e5a6 Fix build 2020-09-30 16:16:45 +05:30
Bhushan Shah 474d0344ca autotests: rename to testInputMethod
Relevant class got renamed, also update the test name

Related: plasma/kwin!302
2020-09-30 16:04:49 +05:30
Méven Car 309a656e00 Screenshot effect: add a screenshotScreens(...) to screenshot specific screens 2020-09-30 07:44:30 +00:00
Cyril Rossi 99bed106bf KCM KWin Manage default Highlight indicator for settings not handled by KCModule
For the following KCM :
* KWin Options
* KWin Screen Edges
* KWin Tabbox

KCModule introduce an indicator to show which settings have changed from
default value. Unfortunately some KCM have settings' states which are not managed
automatically by the KCModule thus we have to handle it manually.

see https://invent.kde.org/frameworks/kconfigwidgets/-/merge_requests/9
2020-09-30 09:10:23 +02:00
l10n daemon script 30b516eceb SVN_SILENT made messages (.desktop file) - always resolve ours
In case of conflict in i18n, keep the version of the branch "ours"
To resolve a particular conflict, "git checkout --ours path/to/file.desktop"
2020-09-30 06:16:48 +02:00
Bhushan Shah 222b558b04 virtualkeyboard: rename class to InputMethod
VirtualKeyboard class does not implement the relevant VirtualKeyboard
protocol but rather implements the InputMethod protcol and can in theory
be used by other input method like e.g. ibus.

Make class name consistent with what it does to avoid confusion in
future.

For now only rename of main class is done and dbus service is kept as-is
to provide retro-compatibility, when input method protocol is
implemented fully, we can think of what to do wrt the dbus interface
later when we fully implement zwp_input_method_unstable_v1 protocol.
2020-09-29 20:55:24 +05:30
Aleix Pol f558115def scene: prefer calling mapToGlobal just once
It's the same top mapToGlobal()+operator& than the other way around and
we get to skip 1 call.
This path is the most common so we better save it.
2020-09-29 14:26:37 +00:00
Andrey Butirsky db202f5c26 fix: redundant keyboard layout OSD notification
there is no need to display the OSD for window we are going to switch from

DIGEST:
BUG: 426122
2020-09-29 14:20:03 +00:00
Andrey Butirsky 2bbab06fc4 fix: wrong keyboard layout OSD notification
DIGEST:
BUG: 426120
2020-09-29 14:20:03 +00:00
Andrey Butirsky 769c8959d8 fix: no OSD indication when switching keyboard layout with Application Policy
When deciding do OSD or not, we need to consider not only last saved layout,
but last actual layout also, when comparing it to current one.

DIGEST:
BUG: 425590
2020-09-29 14:20:03 +00:00
Vlad Zahorodnii 4559d30399 Place internal osd windows according to placement policies
Currently, internal on screen display windows have the bypass window
manager hint set. If that hint is set, the osds must place themselves,
but they don't do it.

As far as I know, there is no any reason why internal OSDs have that
flag set.

By removing the Qt::BypassWindowManagerHint flag, we let kwin core
know that it's okay to place internal OSD windows.

BUG: 400675
2020-09-29 14:06:41 +00:00
Vlad Zahorodnii 6546ac2cae screencast: Replace EGLFence with a glFinish()
The way EGLFence is used is equivalent to calling glFinish().

CCBUG: 425869
2020-09-29 13:57:24 +00:00
Vlad Zahorodnii 6f153552da Allow calling setFrameGeometry() while the client is being resized
Currently, if some script attempts to resize a window while it's being
interactively resized, the corresponding change won't be propagated to
the X server.

The main reason for that is that we don't want to configure the frame
window, the wrapper window, and the client window twice. However, since
Xcb::Window keeps track of the last configured geometry, we can adjust
X11Client::updateServerGeometry() so it only configures windows that
have mismatching geometry.

By doing so, the setFrameGeometry() function can be called by scripts
even when the associated X11 window is being interactively resized.

Note that this bug doesn't affect Wayland windows.

BUG: 426988
2020-09-29 13:55:41 +00:00
Vlad Zahorodnii ddb24eaf0a Fix ghost shadows left by context menus
If the shadow is destroyed immediately before the window is destroyed,
we need to schedule a workspace repaint in order to prevent showing a
"ghost" shadow.

BUG: 425294
2020-09-29 13:53:30 +00:00
Vlad Zahorodnii 12e59f9af8 Schedule workspace repaint for destroyed clients
We need to schedule a workspace repaint in case no effect is going to
animate the window.

The workspace repaint is issued before creating a Deleted because the
latter takes the owner of the effect window, which means that after an
instance of Deleted has been created, visibleRect() returns the frame
geometry.

CCBUG: 425294
2020-09-29 13:53:30 +00:00
Bhushan Shah 6d433bdfc9 virtualkeyboard: add text-input-v3 support 2020-09-29 10:56:24 +00:00
Vlad Zahorodnii a433fb08a3 x11: Make removal of X11 event filters safe
If an X11 event filter has been activated and it unregisters another X11
event filter, then the window manager may crash because the foreach macro
in Workspace::workspaceEvent() makes a copy of m_genericEventFilters or
m_eventFilters and we can call the event() method for an already defunct
filter.

With this change, X11 event filters can be safely removed and installed
at any particular moment.

BUG: 423319
2020-09-29 08:26:28 +00:00
David Edmundson 260e75f6c9 Update systemd units
By marking as part of graphical-session we get a more graceful shutdown.

Also switched to explicit restart inside the unit. Originally I did this
with drop-ins, but this complicates wayland for now.
2020-09-29 06:10:20 +00:00
l10n daemon script cd9acd2e41 SVN_SILENT made messages (.desktop file) - always resolve ours
In case of conflict in i18n, keep the version of the branch "ours"
To resolve a particular conflict, "git checkout --ours path/to/file.desktop"
2020-09-29 06:08:11 +02:00
Carson Black fbab964e98 Use Header color group for decoration colours 2020-09-28 16:08:52 +00:00
Carson Black 02b1e11758 Bump up minimum C++ version to C++17 2020-09-28 16:08:52 +00:00
Aleix Pol 309d6a0d5b Always include the window decoration's clipping
No need to only report opacity on the window decoration if the window
itself is opaque.
2020-09-28 15:00:36 +02:00
Vlad Zahorodnii 688dc9ac1d Adjust kwin to recent window management interface changes 2020-09-28 14:43:34 +03:00
l10n daemon script 25b93b4ccc SVN_SILENT made messages (.desktop file) - always resolve ours
In case of conflict in i18n, keep the version of the branch "ours"
To resolve a particular conflict, "git checkout --ours path/to/file.desktop"
2020-09-27 06:07:58 +02:00
l10n daemon script e534d5abad SVN_SILENT made messages (.desktop file) - always resolve ours
In case of conflict in i18n, keep the version of the branch "ours"
To resolve a particular conflict, "git checkout --ours path/to/file.desktop"
2020-09-26 05:57:20 +02:00
Aleix Pol 375691c6c2 Improve opacity detection
If the opaque area covers all the window's shape, it means that it's an
opaque window.
This is how GTK presents opacity right now, so we'll get to skip
rendering under GTK clients and other compatible ones.
Qt is still not emitting opacity.
2020-09-25 14:08:55 +00:00
Felix Yan a58100fc72 Correct typos in xcbutils.h 2020-09-25 08:45:06 +00:00
Vlad Zahorodnii f24f2bd509 Enable shadow protocol support for all Wayland clients
The main motivation for this change is to enable support for our
proprietary shadow protocol in LayerShellV1Client.

Previously we couldn't move code that handles shadows in WaylandClient
because WaylandClient::bufferGeometry() was a pure virtual method.
2020-09-25 10:10:10 +03:00
Vlad Zahorodnii 989e0987d7 screencast: Ensure that there is current OpenGL context when recording a window
We need an OpenGL context otherwise we may hit an assert in libepoxy.

BUG: 425869
2020-09-24 15:47:56 +03:00
Vlad Zahorodnii 80554a3e12 Expose KWIN_XWL logging category to kdebugsettings 2020-09-24 14:56:35 +03:00
David Edmundson 095cdcd374 Revert "[effects/slidingpopups] Start the animation on only windowAdded or windowClosed"
This reverts commit 9d4c8fda09.

Unlike other effects this wasn't using hide/show as a hack for not
having a created/destroyed signal but because the window is internally
hidden when it's in auto-hide mode despite being still mapped.

BUG: 426686
2020-09-24 12:09:26 +01:00
Vlad Zahorodnii 75cad57cd9 Fix invalidation of cached x stacking order in wayland only mode
Currently, if kwin/wayland runs without xwayland, the order in which
windows are painted doesn't actually reflect the true stacking order.

If the stacking order has been changed, we need to invalidate the
cached x stacking order. But it's done only when RootInfo is present.

If Xwayland doesn't run, RootInfo is not available and thus window
raising is completely broken.

With this change, the x stacking order will be invalidated every time
some window has been raised, no matter what mode kwin operates in.
2020-09-24 09:48:15 +00:00
Andreas Haratzis 6f53f62741 Fix for PlasmaSurfaceTest broken in a3b50500
TestPanelWindowsCanCover now needs to wait for the event queue to process the hover event.
2020-09-24 09:34:29 +00:00
Andreas Haratzis 1dbe3708f5 Fix for potential use-after-free introduced in a3b50500
If showOnScreenEdge is called, immediately followed by the client's destruction, it's possible that the next event queue process will call raiseClient with a destroyed client.
We avoid this by using singleShot that is lifetime-aware.
2020-09-24 09:34:29 +00:00
Vlad Zahorodnii 0c266e760b Replace remaining usages of old connect syntax with new connect syntax
This change replaces the remaining usages of the old connect syntax with
the new connect syntax.

Unfortunately, there are still places where we have to use SIGNAL() and
SLOT() macros, for example the stuff that deals with d-bus business.

Clazy was used to create this change. There were a few cases that needed
manual intervention, the majority of those cases were about resolving
ambiguity caused by overloaded signals.
2020-09-24 09:33:45 +00:00
Vlad Zahorodnii 70b18ae404 Port some KCMs away from deprecated KShortcutsEditor::undoChanges()
undoChanges() has been deprecated in favor of undo() in KF 5.75.
2020-09-24 07:52:44 +00:00
l10n daemon script 102332df00 SVN_SILENT made messages (.desktop file) - always resolve ours
In case of conflict in i18n, keep the version of the branch "ours"
To resolve a particular conflict, "git checkout --ours path/to/file.desktop"
2020-09-24 06:27:23 +02:00
Vlad Zahorodnii 70700b868a Properly test internal window flags
Qt::Popup is a mask, so we cannot use the `&` operator to test the window
type. We need to use QFlags::testFlag() for that purpose instead.
2020-09-23 18:21:24 +03:00
Vlad Zahorodnii bc34736534 Use better window placement heuristics for internal clients
Currently, we do some sort of window placement only for decorated
internal windows, which feels hacky.

With this change, all internal clients will go through the window
placement code, unless it's a popup or the BypassWindowManagerHint
flag is set.

If the BypassWindowManagerHint flag is set, the window must have
valid position.

CCBUG: 400675
2020-09-23 14:39:15 +00:00
Vlad Zahorodnii 960a40ef44 Use right windowDamaged() signal in ThumbnailItem 2020-09-23 16:38:25 +03:00
Vlad Zahorodnii 989699a273 Remove unused things in VirtualKeyboard 2020-09-23 13:59:36 +03:00
Vlad Zahorodnii 22cf80c466 Don't establish text input connections every time focused surface changes
Currently, whenever the focused text input surface changes, the virtual
keyboard will create a bunch of excessive connections. This is leftover
after the old design.
2020-09-23 10:55:30 +00:00
Aleix Pol 9479c0d6b4 Do not call randomly eglGetError() after eglMakeCurrent
If it failed, it will return accordingly, and then we get to call
eglGetError, only when it fails.
2020-09-23 10:05:30 +00:00
Aleix Pol 13dcb46888 Remove unnecessary allocation in GLShader::setUniform(int, const QMatrix4x4 &)
We were creating a vector just to copy it over. We can pass the original
vector just as well.
2020-09-23 10:05:29 +00:00
Aleix Pol 097caa64a5 Improve Compositor::performCompositing
Prefer QVector to QList on local variables.
Iterate with qAsConst on containers that should not change.
2020-09-23 10:05:29 +00:00
Aleix Pol f1233a641d Clean Workspace::updateXStackingOrder()
No need to create x_stacing by iterating over stacking_order, it can be
copied. We are not performing any operations over it.
Also no need to instanciate the tree until we want to use it.
2020-09-23 10:05:29 +00:00
Bhushan Shah 0e05f4e4c2 Add versioning information to the seat_interface->textInputV2 2020-09-23 09:02:05 +00:00
Adrien Faveraux c0f9ed3400 Adapt to changes in the text-input interface 2020-09-23 09:02:05 +00:00
Vlad Zahorodnii 90dce019ad qpa: Expose output names to QScreen
It can be useful for things such as effects.
2020-09-23 06:36:31 +00:00
Aleix Pol 870b411015 Remove unused variable 2020-09-22 19:39:42 +02:00
Aleix Pol 61e655f7f7 Centralize WindowPixmap buffer updating code
Uses a setter and clear method pattern rather than having the code
repeated.
Instead of keeping a QPointer, now we are a QObject and we get notified
about destruction intention directly, so we can clear the pointer when
necessary.
2020-09-22 13:04:35 +00:00
Aleix Pol 26950a65a6 Have Toplevel::damage emit a QRegion
Instead of looping through the rects in the region, emit the region at
bulk. It reduces the amount of emissions we do and allows us to pack the
response accordingly.
2020-09-22 14:45:08 +02:00
Bhushan Shah fd917b4e00 Update version number for 5.20.80
GIT_SILENT
2020-09-21 16:37:41 +05:30
Vlad Zahorodnii 5f7d23fd07 effects/flipswitch: Port away from deprecated QTimeline curve shape prop
QTimeline::CurveShape has been deprecated in Qt 5.15.
2020-09-21 06:16:33 +00:00
Vlad Zahorodnii 99dd5d94c5 effects/cubeslide: Port away from deprecated QTimeline curve shape prop
QTimeline::CurveShape has been deprecated in Qt 5.15.
2020-09-21 06:16:33 +00:00
Vlad Zahorodnii 3d0042e05b effects/desktopgrid: Port away from deprecated QTimeline curve shape prop
QTimeline::CurveShape has been deprecated in Qt 5.15.
2020-09-21 06:16:33 +00:00
Bhushan Shah 426e7f910d virtualkeyboard: slightly restructure the code
Instead of putting code in lambda put them in actual slots, this is
right now not useful but when e.g. TextInputV3 is implemented, this way
we can re-use them.

This also simplifies the code little bit and makes it easier to use with
gdb if needed.
2020-09-21 05:37:52 +00:00
l10n daemon script 240c77a934 SVN_SILENT made messages (.desktop file) - always resolve ours
In case of conflict in i18n, keep the version of the branch "ours"
To resolve a particular conflict, "git checkout --ours path/to/file.desktop"
2020-09-21 06:06:27 +02:00
David Edmundson 578287ec95 Reduce resets in DebugConsole when viewing subsurfaces
subsurfaceTreeChanged is emitted on every damage event. This makes it
very noisy and the model constantly resets. This makes it impossible to
expand the tree (as it resets immediately after).

SubSurfaceMonitor gives us more granular signals whilst handling the
recursive aspect.

Also there are no unmanaged windows that are wayland surfaces, so they
are simplified.
2020-09-19 22:56:38 +00:00
l10n daemon script 3cfec5fdcf SVN_SILENT made messages (.desktop file) - always resolve ours
In case of conflict in i18n, keep the version of the branch "ours"
To resolve a particular conflict, "git checkout --ours path/to/file.desktop"
2020-09-19 06:15:09 +02:00
Andreas Haratzis 71dfd60284 Fix use-after-free when the user hovers over an auto-hide plasma panel in wayland...
Edge::handle calls showOnScreenEdge, which (on wayland) eventually calls internalShow, which eventually calls ScreenEdges::reserve, which destroys the same edge.
When showScreenOnEdge returns, 'this' has been freed.
Using a singleshot timer allows Edge::handle to return before the Edge is destroyed.
2020-09-18 16:00:52 +00:00
Tiago Corrêa 2e93829259 [scripting] Make client.activities writable 2020-09-18 15:57:39 +00:00
Vlad Zahorodnii 79c667ea67 libkwineffects: Bump API version
The API version must be bumped because a new virtual method in the
EffectWindow class had been introduced that breaks BC.
2020-09-18 12:02:46 +03:00
l10n daemon script e6e72d27b9 SVN_SILENT made messages (.desktop file) - always resolve ours
In case of conflict in i18n, keep the version of the branch "ours"
To resolve a particular conflict, "git checkout --ours path/to/file.desktop"
2020-09-18 06:21:14 +02:00
200 changed files with 2368 additions and 1519 deletions

9
3rdparty/xcursor.c vendored
View File

@ -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;
}

4
3rdparty/xcursor.h vendored
View File

@ -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;

View File

@ -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

View File

@ -236,6 +236,7 @@ void AbstractClient::markAsZombie()
{
Q_ASSERT(!m_zombie);
m_zombie = true;
addWorkspaceRepaint(visibleRect());
}
Layer AbstractClient::layer() const

View File

@ -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();

View File

@ -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)

View File

@ -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"

View File

@ -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) {

View File

@ -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

View File

@ -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);

View File

@ -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;

View File

@ -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

View File

@ -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();
}
}

View File

@ -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);

View File

@ -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]

View File

@ -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();
}

View File

@ -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);
}

View File

@ -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();
}
}

View File

@ -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;
};
}

View File

@ -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"));

View File

@ -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;

View File

@ -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);

View File

@ -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);
}

View File

@ -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()

View File

@ -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

View File

@ -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í

View File

@ -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

View File

@ -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

View File

@ -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);
}
}
}

View File

@ -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;

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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()

View File

@ -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

View File

@ -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()

View File

@ -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]=වීදුරු ලෙස පෙනෙන

View File

@ -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);

View File

@ -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()

View File

@ -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

View File

@ -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()

View File

@ -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()

View File

@ -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()

View File

@ -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

View File

@ -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()) {

View File

@ -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 {

View File

@ -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

View File

@ -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 පෙන්වන්න

View File

@ -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;
}

View File

@ -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]=ඇඳීම් පෙන්වන්න

View File

@ -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);

View File

@ -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

View File

@ -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)

View File

@ -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:

View File

@ -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()

View File

@ -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]=लघुछवि बाजू मे

View File

@ -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

View File

@ -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()

View File

@ -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()

View File

@ -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]=විශාලණය

View File

@ -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:

467
inputmethod.cpp Normal file
View File

@ -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));
}
}

79
inputmethod.h Normal file
View File

@ -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

View File

@ -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()});

View File

@ -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);

View File

@ -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;

View File

@ -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;

View File

@ -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

View File

@ -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));

View File

@ -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));

View File

@ -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;

View File

@ -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

View File

@ -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

View File

@ -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;

View File

@ -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

View File

@ -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"
}
}
}
}

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -31,6 +31,7 @@ Name[nn]=Vidaugs­flytting
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

View File

@ -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

View File

@ -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)

View File

@ -77,6 +77,7 @@ protected:
private Q_SLOTS:
void focusPolicyChanged();
void updateMultiScreen();
void updateDefaultIndicator();
private:

View File

@ -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

View File

@ -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");

View File

@ -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;
}
}

View File

@ -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();

View File

@ -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

View File

@ -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);
}

View File

@ -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();

View File

@ -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

View File

@ -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;
};

View File

@ -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

View File

@ -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