Summary:
When using the natural layout algorithm with the fill-gaps option, a small
error (less than one) is introduced in windows' aspect ratio each time they are
enlarged due to floating-point roundoff.
Currently, the algorithm computes the width and height enlargement factors and
then attempts to enlarge in each of the four possible directions, repeating
until it can't enlarge any windows any further. Hence, this aspect ratio error
can be multiplied by up to four. Especially for small, long, and narrow
windows, this can result in a total error of greater than one by the end of
that loop iteration. If this occurs, on subsequent iterations the height
enlargement factor might then be computed as negative violating some of the
core assumptions of the algorithm and resulting in the loop iterating endlessly
until one of the window dimensions overflows, freezing the program for up to
several minutes.
To fix this, the height enlargement factor should be re-computed based on the
new width each time the window is enlarged, ensuring the error introduced in
the aspect ratio never exceeds one.
BUG: 364709
BUG: 380865
BUG: 368811
FIXED-IN: 5.15.0
Test Plan:
The most reliable way to reproduce the freeze seems to be to activate the
desktop-grid effect while a tool-tip window is fading in.
Ensure desktop-grid is configured to use present windows, and that present
windows is configured to use the natural layout algorithm with the fill gaps
option selected.
The freeze is still intermittent, but using this method should be able to be
triggered within about 10 tries without this fix.
After applying the fix, the freeze has never been observed.
Reviewers: #kwin, zzag
Reviewed By: #kwin, zzag
Subscribers: graesslin, kwin, zzag
Tags: #kwin
Differential Revision: https://phabricator.kde.org/D16278
Summary:
There is no concept of managed windows in Wayland, so every time we call
managed() on a Wayland client, it will return false.
This change addresses that problem by invoking managed() only for X11 clients.
CCBUG: 398100
Test Plan:
* Open KCM of the Translucency effect and decrease opacity of inactive windows;
* Open Dolphin;
* Click on desktop.
Reviewers: #kwin, davidedmundson
Reviewed By: #kwin, davidedmundson
Subscribers: kwin
Tags: #kwin
Differential Revision: https://phabricator.kde.org/D16319
Summary:
There is no concept of managed windows in Wayland, so every time we call
managed() on a Wayland client, it will return false. We need to call
that method only for X11 clients.
The resource name part for authentication agents is empty because
KWayland can't get their executable paths.
CCBUG: 398100
Test Plan:
Before:
{F6338545}
After:
{F6338546}
Reviewers: #kwin, davidedmundson
Reviewed By: #kwin, davidedmundson
Subscribers: davidedmundson, kwin
Tags: #kwin
Differential Revision: https://phabricator.kde.org/D16317
Summary:
There is no concept of managed windows in Wayland, so every time we call
managed() on a Wayland client, it will return false.
This change addresses that problem by invoking managed() only for X11 clients.
CCBUG: 398100
Reviewers: #kwin, davidedmundson
Reviewed By: #kwin, davidedmundson
Subscribers: kwin
Tags: #kwin
Differential Revision: https://phabricator.kde.org/D16312
Summary:
In some cases, the out transition is false-triggered because we don't
react to changes in the keep-above and the full screen state.
Test Plan:
* Set the keep-above state on a window;
* Click on the desktop;
* (the window didn't "flicker")
Reviewers: #kwin, davidedmundson
Reviewed By: #kwin, davidedmundson
Subscribers: davidedmundson, abetts, kwin
Tags: #kwin
Differential Revision: https://phabricator.kde.org/D16270
Summary: Do the same what we do on X11.
Reviewers: #kwin, davidedmundson
Reviewed By: #kwin, davidedmundson
Subscribers: kwin
Tags: #kwin
Differential Revision: https://phabricator.kde.org/D16271
Summary:
We don't really have to have two different code paths for group
transients and ordinary transients. For now, AbstractClient::hasTransient
is good enough to check the relationship between potential parent and
the transient.
In long term, we need to "invert" the relationship, instead of checking
whether given parent window has a transient, we should check whether
given transient is a transient for a given window so we can keep Deleted
transients above their old parents.
Reviewers: #kwin, davidedmundson
Reviewed By: #kwin, davidedmundson
Subscribers: kwin
Tags: #kwin
Differential Revision: https://phabricator.kde.org/D15893
Summary:
Such an option would be useful for people that are used to watch videos
in the fullscreen mode.
By default, we still dim fullscreen windows because watching videos in
fullscreen mode is not the only one use-case. One could have a text
editor in fullscreen mode on one screen and Konsole on another screen.
In that case, it would be desired to dim the text editor if the latter
is active. Also, because we don't have stats of how the fullscreen mode
is used by KDE Plasma users.
BUG: 399822
FIXED-IN: 5.15.0
Test Plan:
* Unchecked the "Fullscreen windows" checkbox;
* Opened Konsole;
* Opened Firefox in the fullscreen mode;
* Pressed Alt+Tab;
* (Firefox stayed bright)
Reviewers: #kwin, #plasma, davidedmundson
Reviewed By: #kwin, #plasma, davidedmundson
Subscribers: kwin
Tags: #kwin
Differential Revision: https://phabricator.kde.org/D16216
Summary:
Same is done on X11 (see Client::updateMouseGrab), so we should have this
on Wayland as well.
Also adding the pointer confinement restriction for modifier + wheel.
Test Plan: Run new and adjusted testcases with and without the change
Reviewers: #kwin, #plasma
Subscribers: kwin
Tags: #kwin
Differential Revision: https://phabricator.kde.org/D16025
Avoids triggering an assert and communicates that the timeout is running.
Ideally, there was a countdown label of some sort but this is better than crashing.
BUG: 399644
FIXED-IN: 5.12.8
Differential Revision: https://phabricator.kde.org/D16124
QSize default constructor does not set width/height to 0,0 but instead
to an invalid size -1,-1. This went unnoticed as Qt5.12 corrected these
values to the intended 0,0.
Reviewed By: Roman Gilg
Summary:
The Dim Inactive effect expects that the windowClosed signal always
proceeds the windowDeleted signal. But in some cases that's not the case.
If a window gets destroyed before becoming ready for painting, only
the windowDeleted signal will be emitted. In addition to that, KWin will
activate that window, which means we'll probably start a transition for
it.
Because this effect cannot terminate active transitions for such
windows, KWin can crash in postPaintScreen.
This change addresses the crash in postPaintScreen by adding extra clean
up stuff in the windowDeleted slot to make sure that there are no
transitions for deleted windows.
The proper fix would be to not emit windowActivated signal for windows
that are not ready for painting.
BUG: 399612
FIXED-IN: 5.14.1
Test Plan:
Ran
```
x <- seq(5, 15, length=1000)
y <- dnorm(x, mean=10, sd=3)
plot(x, y, type="l", lwd=1)
```
in RKWard multiple times.
Reviewers: #kwin
Subscribers: kwin
Tags: #kwin
Differential Revision: https://phabricator.kde.org/D16130
Summary:
In order to check whether a window is on some particular virtual
desktop, one has to use isOnDesktop.
Also, this change adds implicit support for the new virtual desktop protocol.
Test Plan:
Switched between virtual desktops with a Konsole window being on all
desktops.
Reviewers: #kwin, davidedmundson
Reviewed By: #kwin, davidedmundson
Subscribers: kwin
Tags: #kwin
Differential Revision: https://phabricator.kde.org/D16103
Summary:
If a window was moved to another virtual desktop, then it would be faded
in. The desired behavior is to not animate it at all.
Test Plan: Moved a Konsole window between virtual desktops, it stayed opaque.
Reviewers: #kwin, davidedmundson
Reviewed By: #kwin, davidedmundson
Subscribers: kwin
Tags: #kwin
Differential Revision: https://phabricator.kde.org/D16102
Summary:
If a modal window is closed and some alternative effect that animates
the disappearing of windows is enabled(e.g. the Glide effect, or the
Scale effect), the Dialog Parent effect can cause flickering of the
parent window because its animation duration doesn't match duration of
those alternative effects.
Also, if the Fade effect, the Glide effect, and the Scale effect are
disabled, the Dialog Parent will keep the parent window alive for no
good reason.
This change addresses that problem by adding keepAlive property to
`animate` function so scripted effects have more control over lifetime
of animated windows.
If both a modal window and its parent window are closed at the same time
(and there is no effect that animates the disappearing of windows), the
Dialog Parent will stop immediately(because windowDeleted will be
emitted right after windowClosed signal).
If both a modal window and its parent window are closed at the same time
(and there is effect that animates the disappearing of windows), the
Dialog Parent won't reference the latter window. Thus, it won't cause
flickering. I.e. it will "passively" animate parent windows.
BUG: 355036
FIXED-IN: 5.15.0
Reviewers: #kwin, davidedmundson
Reviewed By: #kwin, davidedmundson
Subscribers: davidedmundson, kwin
Tags: #kwin
Differential Revision: https://phabricator.kde.org/D14919
Summary:
There's an attempt to block updates to activities whilst the popup menu
is showing.
In one of the two code paths for positioning the menu the block is set
but instead of releasing the block at the end of the exec locks it
again.
CCBUG: 335725
Test Plan:
On X11 changed activities with the popup menu near the bottom.
It still flickered like crazy whilst the menu is open (see bug report)
But now at least fixes itself after
Reviewers: #kwin, zzag
Reviewed By: #kwin, zzag
Subscribers: kwin
Tags: #kwin
Differential Revision: https://phabricator.kde.org/D16101
Summary:
Previously when updating the state we would send a configure event with
the size 0,0. This means the client chooses the size. For regular window
this works as most toolkits treat this to mean the size that we
previously requested. It's not explicit in the spec either way.
For maximised windows it's a problem, the spec clearly states that when
maximised clients must follow the size given. Telling the client to be
0,0 doesn't make sense.
By always sending our last requested size we remove any ambiguity.
Test Plan:
Ran
Maximised some windows and changed focus
WAYLAND_DEBUG showed we weren't sending a configure with 0,0
after startup
Reviewers: #kwin, zzag
Reviewed By: #kwin, zzag
Subscribers: zzag, kwin
Tags: #kwin
Differential Revision: https://phabricator.kde.org/D16055
Summary:
This lets other effects know whether they should inhibit or not which
reduces
visual glitches of overlapping animations.
BUG: 321201
FIXED-IN: 5.15.0
Test Plan: Switched desktops, they still faded
Reviewers: #kwin, zzag
Subscribers: zzag, kwin
Tags: #kwin
Differential Revision: https://phabricator.kde.org/D15474
Summary:
Qt does not like having no screens. Both Qt XCB and Wayland QPAs have
systems pretend there's always at least 1 screen
present.
Kwin already uses a dummy screen on startup, this patch reinserts the
dummy screen if the platform states that all real screens are removed.
BUG: 399564
Test Plan:
Logged in, everything still worked
Did not reproduce the original bug
Reviewers: #kwin, zzag
Reviewed By: #kwin, zzag
Subscribers: kwin
Tags: #kwin
Differential Revision: https://phabricator.kde.org/D16096
Summary:
This code has several bugs, it's untested, it's not used anywhere, it
adds unnecessary complexity -> delete it.
Test Plan: Compiles.
Reviewers: #kwin, davidedmundson
Reviewed By: #kwin, davidedmundson
Subscribers: kwin
Tags: #kwin
Differential Revision: https://phabricator.kde.org/D16099
Summary:
The fullscreen effect lock is purely an implementation detail of the
AnimationEffect, we don't need to have it in the public API.
Test Plan: KWin still compiles.
Reviewers: #kwin, davidedmundson
Reviewed By: #kwin, davidedmundson
Subscribers: kwin
Tags: #kwin
Differential Revision: https://phabricator.kde.org/D16075
Summary:
If one wants to drag a maximized window while he or she has enabled both
the Wobbly Windows and the Maximize effect, visual artifacts can be
shown.
When the Maximize effect animates transition from maximize to restore,
some parts of the window can overshoot repaint regions(because of
wobbliness), leaving us with the visual artifacts.
To fix that, we have to take into account current scale and translation
when calculating dirty region in the Wobbly Windows effect.
BUG: 370612
FIXED-IN: 5.14.1
Test Plan: When dragging maximized windows, there are no visual artifacts anymore.
Reviewers: #kwin, davidedmundson
Reviewed By: #kwin, davidedmundson
Subscribers: abetts, kwin
Tags: #kwin
Differential Revision: https://phabricator.kde.org/D15961
Summary:
The Scale effect and the Glide effect have to animate only ordinary
windows(i.e. the ones that are considered to be apps).
On X11, in order to distinguish ordinary windows from combo box popups,
popup menus, and other popups, those effects check whether given window
is managed.
On Wayland, there is no concept of managed/unmanaged windows.
XDG Shell protocol defines 2 surface roles:
* xdg_toplevel;
* and, xdg_popup.
The former can be used to implement typical windows, the ones that can
be minimized, maximized, etc.
The latter can be used to implement tooltips, popup menus, etc. Thus,
that's a good criteria to filter popup windows.
CCBUG: 398100
Reviewers: #kwin, graesslin, davidedmundson
Reviewed By: #kwin, graesslin, davidedmundson
Subscribers: davidedmundson, kwin
Tags: #kwin
Differential Revision: https://phabricator.kde.org/D15117
Summary:
If a window is being slided in and for some reason it gets closed, the
window will be slided out. The problem is that there is a jump between
the slide in animation and the slide out animation.
The reason for that is we cancel the slide in animation when the slide
out animation is started.
It makes sense to cancel previously active animations because they have
different durations. But visually, it doesn't look good.
TimeLine tries to preserve progress value when changing duration. Thus,
let's utilize that to fix the jump.
This change matters only with animation speed factor > 1.0.
CCBUG: 264276
Test Plan: Manually.
Reviewers: #kwin, davidedmundson
Reviewed By: #kwin, davidedmundson
Subscribers: abetts, kwin
Tags: #kwin
Differential Revision: https://phabricator.kde.org/D15626
Summary:
This exposes colorScheme as a property which is then usable by kwin
scripts.
Wanted by T9769.
Test Plan:
Michail to test in a script.
Reviewers: #kwin, zzag, graesslin
Reviewed By: #kwin, zzag, graesslin
Subscribers: mvourlakos, zzag, kwin
Tags: #kwin
Differential Revision: https://phabricator.kde.org/D15913
Summary:
GammaRamp deletes an array in the destructor thus we have to either
declare our own copy constructor and copy assignment operator or
delete them both.
GammaRamp looks more like an identity rather than a value so both copy
constructor and copy assignment operator were deleted.
Test Plan: Compiles.
Reviewers: #kwin, romangg
Reviewed By: #kwin, romangg
Subscribers: kwin
Tags: #kwin
Differential Revision: https://phabricator.kde.org/D16023
Summary:
The change to make maximize mode asynchronous featured the comment
>Things are a bit complex with borders. Technically we
>shouldn't update them till we get a response, but we also need to have
>the correct geometry of the full size window in our request. For now
>they behave as before, updating when we request the change.
We call setNoBorder when we request the geometry but decoratedClient
also checks the maximise mode, in order to follow the scheme above we
need this to operate on the requested state not current state.
X is unaffected.
This fixes the borders being restored correct after maximize/restore.
Test Plan:
Chose a theme with visible borders
Maximised a window and back
They restored
Reviewers: #kwin, zzag
Reviewed By: #kwin, zzag
Subscribers: zzag, kwin
Tags: #kwin
Differential Revision: https://phabricator.kde.org/D15991
Summary:
The function was introduced in 2d99ef918b.
It's not used anywhere plus we don't need it anymore because
AbstractClient::isActiveFullscreen checks main clients.
Test Plan: Compiles.
Reviewers: #kwin, davidedmundson
Reviewed By: #kwin, davidedmundson
Subscribers: kwin
Tags: #kwin
Differential Revision: https://phabricator.kde.org/D16022