Summary:
As described in https://bugreports.qt.io/browse/QTBUG-57714 exposing a
QWidget as a context item to QtQuick can crash. Especially as the
engine's context property gets deleted whilst deleting the parent item.
This patch reworks the code so that the models are exposed to QML
directly rather than going through a QWidget.
CCBUG: 373628
Test Plan:
Pressing back whilst in the decoration KCM used to crash every time, now it doesn't.
I still have the buttons.
Reviewers: #plasma, graesslin
Reviewed By: #plasma, graesslin
Subscribers: graesslin, cfeck, plasma-devel
Tags: #plasma
Differential Revision: https://phabricator.kde.org/D4533
Summary:
So far we didn't trigger modifier-only-shortcuts when capslock was
enabled. In fact we even ensured that the shortcuts did not trigger.
This seems not to be what our users expect. Meta should still trigger
if capslock is on.
This change modifies the logic to determine which modifier is currently
pressed by using the modifiersRelevantForGlobalShortcuts. The difference
to the "normal" modifiers is that this excludes capslock from modifiers
and excludes consumed modifiers. The latter is not really relevant as
modifier-only-shortcuts do not trigger if multiple keys are pressed,
which is required to have a modifier consumed.
BUG: 375355
FIXED-IN: 5.8.6
Test Plan: Only with adjusted autotest
Reviewers: #kwin, #plasma
Subscribers: plasma-devel, kwin
Tags: #kwin
Differential Revision: https://phabricator.kde.org/D4241
Summary:
Xkbcommon does not localize the layout names. We always get the US
English variant. KWin so far passed the strings from xkbcommon directly
to UI visible parts such as the Plasma OSD. This results in not
translated elements in our UI.
As I figured out today the translations exist in the domain
xkeyboard-config. Passing the strings from xkbcommon through this domain
gives us translated layouts.
Unfortunately the xkeyboard-config is not installed by default on all
distributions. E.g. on ubuntu/neon one needs to install xkb-data-i18n
to have the translations available.
Test Plan: Untested as I fail to start Plasma/5.8 KWin on my dev system
Reviewers: #kwin, #plasma
Subscribers: plasma-devel, kwin
Tags: #kwin
Differential Revision: https://phabricator.kde.org/D4243
This extends the testCapsLock to ensure that modifier only shortcut
trigger when capslock is enabled. So far the test only ensured that
capslock doesn't trigger the shift modifier only shortcut.
As the test shows currently when capslock is on, the meta key doesn't
trigger any more.
CCBUG: 375355
Typically after deselecting "Show caps" option, the associated options "Cap color" and "Display image on caps" are grayed out (triggered by signal). The bug was when Desktop Cube settings were closed and opened again then the options were not grayed out.
Succesfully compiled and tested by deselecting "Show caps" option in Desktop Cube settings, closing the settings window and opening it once again. The options "Cap color" and "Display image on caps" were then grayed out.
REVIEW: 129194
In case we need to set the SwitcherItem model in
`TabBoxHandlerPrivate::show()`, remember the current index row,
otherwise it gets reset to the first item.
Reviewers: #kwin, graesslin
Tags: #kwin
Differential Revision: https://phabricator.kde.org/D4162
BUG: 333511
Summary:
Currently the configure button is aligned to the win decoration in the
background. This is bound to 40 - the inactive decorations shadow.
This means the configure button ends up in different places across each
item,
looking a bit weird and potentially not even on top of the right
delegate.
This patch aligns the configure button relative to the overall delegate
so that it's in the same place on every item
Test Plan: Looked at KCM
Reviewers: #plasma
Subscribers: plasma-devel, kwin
Tags: #kwin
Differential Revision: https://phabricator.kde.org/D3526
BUG: 372685
Summary:
The method is supposed to return the AbstractClient's size for a given
client size. That is the size including the window decoration.
The default implementation returned the passed in client size without
adjusting for the decoration. This resulted in ShellClient getting a
wrong size especially when AbstractClient::adjustedClientSize (which
calls sizeForClientSize) was called.
The result of the incorrect size was for example a shrinking of the
window when starting to resize a window.
BUG: 370345
FIXED-IN: 5.8.4
Reviewers: #kwin, #plasma_on_wayland, broulik, subdiff
Subscribers: plasma-devel, kwin
Tags: #plasma_on_wayland, #kwin
Differential Revision: https://phabricator.kde.org/D3414
Summary:
When windows get added some effects grab the window and want to be the
only one animating this window. For this the grab roles exists. An
effect being notified later on evaluates the grab state and does not
start the animation.
This process failed due to being dependent on the order the effects are
loaded. Window Added/Closed are signals emitted by EffectsHandler, thus
first come, first serve. The requested effect order does not play into
it.
Due to that it could happen that an Effect which should not animate,
started to animate as the grab was still there.
This change adds the possibility to be notified whenever the window data
changes. A new signal is added to EffectsHandler which is emitted
whenever the windowData changes. The interested effects connect to it
and cancel their (just started) animation for the window.
Adjusted effects are:
* ScaleIn
* Fade
* WobblyWindows
In case of WobblyWindows an additional logical error was fixed that the
animations were only run when an effect grabbed instead of the other way
around.
BUG: 336866
FIXED-IN: 5.8.4
Reviewers: #kwin, #plasma, broulik
Subscribers: plasma-devel, kwin
Tags: #kwin
Differential Revision: https://phabricator.kde.org/D3211
Summary:
The QStyle might interact with our internal Wayland connection. If the
cleanup happens after destroying our internal Wayland connection KWin
will crash at tear-down.
With this change the QStyle can perform cleanup already prior to the
deconstruction of the Wayland connection.
CCBUG: 372001
Reviewers: #kwin, #plasma_on_wayland
Subscribers: plasma-devel, kwin
Tags: #plasma_on_wayland, #kwin
Differential Revision: https://phabricator.kde.org/D3241
Summary:
The killer can only kill X11 windows. It is also only invoked for Client
and not for ShellClient. The tool interacts with QX11Info which means it
would crash if tried to use on Wayland.
Thus force platform xcb on the tool.
Test Plan: Killer shows for Xwayland windows.
Reviewers: #kwin, #plasma_on_wayland
Subscribers: plasma-devel, kwin
Tags: #plasma_on_wayland, #kwin
Differential Revision: https://phabricator.kde.org/D3228
Summary:
So far KWin used the window title provided from the window directly
without any sanitizing. This could result in broken window decorations
if the title included line breaks. Those were passed to the decoration
and depending on the way how the decoration renders the title, it could
result in visual breakage.
Having line breaks in a window title doesn't make sense. Given that KWin
now simplifies the title when copying it to it's own structure. This
also ensures that the title passed to e.g. task manager does not have
any line breaks on Wayland.
BUG: 323798
FIXED-IN: 5.8.4
Test Plan: Opened the web page in a nested KWin, properly rendered now.
Reviewers: #kwin, #plasma
Subscribers: plasma-devel, kwin
Tags: #kwin
Differential Revision: https://phabricator.kde.org/D3215
Summary:
Desktop Grid has a feature that right or middle clicking a window toggles
the on all desktop state. If that is done for a desktop window, things
obviously start to fail.
KWin internally allows to change virtual desktop for all windows, even
for windows like the desktop or docks. Changing in KWin core is not a
solution.
Thus a special casing in desktop grid is added to disallow the selection
for desktop windows.
BUG: 372037
FIXED-IN: 5.8.4
Test Plan: Tried right clicking desktop window and other windows.
Reviewers: #kwin, #plasma
Subscribers: plasma-devel, kwin
Tags: #kwin
Differential Revision: https://phabricator.kde.org/D3253
Summary:
For whatever reason Qt scrolled the wrong way on internal windows. As a
new QWheelEvent is constructed anyway, just multiply by -1 to get the
direction fixed.
BUG: 371999
FIXED-IN: 5.8.4
Test Plan: Tried debug console in nested setup, scrolled correctly now.
Reviewers: #kwin, #plasma_on_wayland, broulik
Subscribers: plasma-devel, kwin
Tags: #plasma_on_wayland, #kwin
Differential Revision: https://phabricator.kde.org/D3247
Summary:
This change ensures that the DebugConsole does not have a minimize
button.
BUG: 372000
FIXED-IN: 5.8.4
Reviewers: #kwin, #plasma_on_wayland, broulik
Subscribers: plasma-devel, kwin
Tags: #plasma_on_wayland, #kwin
Differential Revision: https://phabricator.kde.org/D3244
Summary:
When moving windows we don't want to snap against not visible windows
like auto-hidden panels.
BUG: 365892
FIXED-IN: 5.8.4
Test Plan: So far only auto-test, manual test will follow.
Reviewers: #kwin, #plasma
Subscribers: plasma-devel, kwin
Tags: #kwin
Differential Revision: https://phabricator.kde.org/D3225
The export of the WorkspaceWrapper was changed to be a subclass with all
the elements still being in the parent class. But the "workspace" was
exported with QScriptEngine::ExcludeSuperClassContents. Thus all usages
of workspace were broken and our tests started to fail on build.kde.org.
This change removes the ExcludeSuperClassContents which means that also
the QObject properties and slots are now exposed which was previously
not the case.
CCMAIL: github@chilon.net
Summary:
The version provided is only compatible with QtScript so it became
necessary to split WorkspaceWrapper into a base class and two child
classes, one for QtScript and one for QmlScript.
BUG: 340125
FIXED-IN: 5.8.4
REVIEW: D3185
Summary:
QSpinBox can't handle plural suffixes. Something previously done by
KIntSpinBox.
Using setSuffix(ki18np("pixel", "pixels")).toString() does nothing, as
at the time of conversion we don't know which one to use.
This patch uses KPluralHandlingSpinBox and correct ki18np.
Note, "new" dependency was already linked implicitly in other kwin, but
we need to add it for this KCM.
Test Plan:
Opened KCM (in English) set counter to 1 pixel and 2 pixels.
No longer had a big warning. Also appropriate number of s's appeared.
Reviewers: #plasma
Subscribers: plasma-devel, kwin
Tags: #kwin
Differential Revision: https://phabricator.kde.org/D3222
The test illustrates that special characters like a line break are not
removed from the window caption, which results in a line break added in
the window decoration.
Test case uses a title from a web page triggering it in Firefox.
CCBUG: 323798
Summary:
When triggering a move resize all following pointer events are grabbed
by KWin itself. Thus the correct behavior is to informe the client about
it and send a pointer leave.
This ensures that after the move resize ended the pointer gets a new
enter. By sending anew pointer enter the position gets updated to the
new position which so far did not happen and the client generated events
on the wrong position.
BUG: 371573
FIXED-IN: 5.8.3
Reviewers: #kwin, #plasma_on_wayland, broulik
Subscribers: plasma-devel, kwin
Tags: #plasma_on_wayland, #kwin
Differential Revision: https://phabricator.kde.org/D3154
The first test case was sometimes failing due to the time value in the
first render pass being too high. So that the effect ended directly for
the window.
This change adds a small waiting time for the compositor to render prior
to the creation of the window. Ideally we would connect to frameRendered
signal, but the OpenGL compositor doesn't emit it yet.
Test more combinations of other effects together with sliding popups.
The problem does not only exist for scale in but for pretty much any
effect that the ordering in which the effects get loaded makes the test
pass or fail.
Some effects require OpenGL, as build.kde.org does not support OpenGL
compositing (yet), the tests only do the OpenGL cases if an OpenGL
compositor could be created.
CCBUG: 336866
The test case loads the sliding popups effect and the scale in effect
which also operates on added windows. As the test case shows depending
on the sequence how the effects are loaded, the window gets animated by
both effects (wrong) oor only sliding popups.
CCBUG: 336866
Summary:
registerShortcut is available to javascript KWin scripts but was not
available to those written in declarative script.
BUG: 340225
FIXED-IN: 5.8.4
REVIEW: 129250
Summary:
It can happen that startAnimation is invoked multiple times for a
window. In case it was invoked a second time the previous animation was
not cancelled. This resulted in the set-animation to never end. When
closing a window, it would stay around as a translucent, non-interactive
window zombie.
This change ensures that existing animations get cancelled.
BUG: 342716
FIXED-IN: 5.8.3
Test Plan: Tested through autotest and manually.
Reviewers: #kwin, #plasma
Subscribers: plasma-devel, kwin
Tags: #kwin
Differential Revision: https://phabricator.kde.org/D3190
Summary:
When the decoration size changes the textures get recreated and need to
be properly filled. So far KWin used the scheduled repaint geometry in
this situation. If the decoration didn't schedule the complete geometry
for repain there will be an empty area in the decoration texture.
This change ensures that the complete texture gets repainted when they
are recreated. Thus the decoration rendering is more fault tolerant
towards potential bugs in the decoration. With no-compositing and XRender
compositing this problem was not reproducable and already fault tolerant,
so OpenGL just catches up with the other modes.
BUG: 371735
FIXED-IN: 5.8.3
Reviewers: #kwin, #plasma
Subscribers: plasma-devel, kwin
Tags: #kwin
Differential Revision: https://phabricator.kde.org/D3186
Summary:
Client::updateInputWindow operates with the decoration size. The method
gets called from various points when changing the window geometry. If at
that moment the decoration has not updated yet, the borders might be at
a wrong position.
This behavior could be triggered when a window requested to change the
state to maximized. During maximization the decoration still had the
wrong size when updateInputWindow was called, thus an interactive area
inside the window was created.
To circumvent this problem updateInputWindow is now also called whenever
the window decoration changes.
As a note: that a maximized window has resize only borders is wrong. Kwin
should be protected against that.
BUG: 371284
FIXED-IN: 5.8.3
Test Plan: Checked xwininfo for the deco extends window
Reviewers: #kwin, #plasma
Subscribers: plasma-devel, kwin
Tags: #kwin
Differential Revision: https://phabricator.kde.org/D3151
This test case simulates a condition of the translucency effect
modifying windows of certain types (e.g. dialogs).
In case the effect got activated for a window it does not end after the
window gets closed and creates a non-interactive zombie window.
CCBUG: 342716
On build.kde.org the autotests started to crash on tear down due to a
newer Wayland library. The reason is that the KWayland::Client::Outputs
are destroyed after the internal Wayland connection is destroyed.
This change parents the created Outputs to the Registry like the other
objects. To ensure that the KWin::QPA::Screen doesn't have a problem
with that, it is changed to a QPointer - nullptr checks are already in
place.
Hopefully that will fix the crashes on build.kde.org, but there is a
chance that more errors are hidden.
Summary:
With nouveau driver it can happen that KWin gets frozen when first trying
to render with OpenGL. This results in a freeze of the complete desktop
as the compositor is non functional.
Our OpenGL breakage detection is only able to detect crashes, but not
freezes. This change improves it by also added a freeze protection.
In the PreInit stage a thread is started with a QTimer of 15 sec. If the
timer fires, qFatal is triggered to terminate KWin. This can only happen
if the creation of the OpenGL compositor takes longer than said 15 sec.
In the PostInit stage the timer gets deleted and the thread stopeed
again.
Thus if a freeze is detected the OpenGL unsafe protection is written into
the config. KWin aborts and gets restarted by DrKonqui. The new KWin
instance will no longer try to activate the freezing OpenGL as the
protection is set.
If KWin doesn't freeze the protection is removed from the config as
we are used to.
Check for freezes for the first n frames, not just the first
This patch changes the freeze detection code to detect freezes in the
first 30 frames (by default, users can change that with the
KWIN_MAX_FRAMES_TESTED environment variable). This detects
successfully the freezes associated to nouveau drivers
in https://bugzilla.suse.com/show_bug.cgi?id=1005323
Reviewers: davidedmundson, #plasma, #kwin, graesslin
Reviewed By: #plasma, #kwin, graesslin
Subscribers: luebking, graesslin, kwin, plasma-devel, davidedmundson
Tags: #plasma
Differential Revision: https://phabricator.kde.org/D3132