Summary:
The Dim Inactive effect sees the world a little bit differently.
m_activeWindow is currently active window that can be dimmed later on.
In most cases, it's the same as effects->activeWindow(). In rare cases,
it can be nullptr, even when effects->activeWindow() is not equal to nullptr
(e.g. when active window is a context menu popup).
canDimWindow is a helper that returns true if a given window should be
dimmed, otherwise it returns false. It has one special case: if a given
window is equal to m_activeWindow, return false. I.e. don't dim active
windows.
Currently, if user changes config of this effect, active window becomes
dimmed.
The reason for that is we hit that special case when deciding whether
effects->activeWindow() should be m_activeWindow.
This change addresses that problem by resetting m_activeWindow so we
don't hit that special case.
Test Plan:
* Opened KCM of this effect;
* Changed strength;
* (the KCM window stayed bright after I clicked "Apply" button).
(everything else works as expected)
Reviewers: #kwin, davidedmundson
Reviewed By: #kwin, davidedmundson
Subscribers: kwin
Tags: #kwin
Differential Revision: https://phabricator.kde.org/D14973
Summary:
The Dim Inactive effect was rewritten mostly to fix most of issues with
it, e.g. after leaving a full screen effect(e.g. Desktop Grid) windows
sometimes are not dimmed back, or when a window becomes inactive there
is no smooth transition, etc.
{F5956124}
//Before: the window is not smoothly dimmed.//
{F5956127}
//After: the window is smoothly dimmed.//
In combination with an effect that animates the disappearing of windows,
e.g. Glide, the rewritten Dim Inactive effect doesn't "flash" windows.
If an active window has been closed, it will stay bright. If an inactive
window has been closed, it will stay dimmed.
Among other changes, the KCM has been re-designed to follow common KCM
design in Plasma:
{F5956128, layout=center, size=full}
The way the rewritten Dim Inactive effect handles flashing/flickering problem can be
reused in the Dialog Parent effect.
### Demo
{F5959885}
//Before: dimming of a window group.//
{F5959886}
//After: Dimming of a window group.//
Depends on D13740
CCBUG: 359251
Test Plan:
Test plan #1
* Activated the Desktop Grid effect
* Dimmed windows smoothly brightened
* Left desktop grid
* Windows dimmed back
Test plan #2
* Opened Dolphin and its Preferences window
* Clicked on desktop, both Dolphin and the Preferences window dimmed
* Clicked on Dolphin, both windows smoothly brightened back
Reviewers: #kwin, #plasma, #vdg, davidedmundson
Reviewed By: #kwin, #plasma, #vdg, davidedmundson
Subscribers: davidedmundson, abetts, ngraham, kwin
Tags: #kwin
Differential Revision: https://phabricator.kde.org/D13720
stackingOrder is an interesting property which needed
special handling in the port. Add an explicit test.
Test Plan: #kwin
Reviewers: broulik
Reviewed By: broulik
Subscribers: zzag, kwin
Tags: #kwin
Differential Revision: https://phabricator.kde.org/D14533
Summary:
* Slightly improve readability;
* Check that offset and location have been passed;
* Sanitize slide in/out duration (if any of those is equal to 0, KWin
will crash).
Test Plan:
* Launched Yakuake;
* Pressed F12 several times (Yakuake still slides in/out).
Reviewers: #kwin, davidedmundson
Reviewed By: #kwin, davidedmundson
Subscribers: davidedmundson, kwin
Tags: #kwin
Differential Revision: https://phabricator.kde.org/D14862
Summary:
Comments like "// Call the next effect." are sort of
// Add 1 to foo.
foo += 1
they don't give any useful information and it would be better without
them.
Test Plan: Still compiles.
Reviewers: #kwin
Subscribers: davidedmundson, kwin
Tags: #kwin
Differential Revision: https://phabricator.kde.org/D14728
Summary:
We don't have anymore the following effects:
* Box Switch (was removed in 4.11);
* Explosion (was removed in 4.11);
* Outline (was removed in 4.11);
* Scale In (will be removed in 5.14);
* Taskbar Thumbnails (was removed in 4.95).
So, keywords for those effects should not be among search suggestions in
System Settings.
Reviewers: #kwin, #plasma, davidedmundson
Reviewed By: #kwin, #plasma, davidedmundson
Subscribers: kwin
Tags: #kwin
Differential Revision: https://phabricator.kde.org/D14765
Summary:
Using QtQuick.Controls for Label and TextField can result in blurry font rendering for a fractional scaling (e.g. 1,5). There is a work around for QtQuick.Controls 2.x therefore using QtQuick.Controls 2.0 for Label and TextField resolves the problem
BUG: 366451
Reviewers: #kwin, davidedmundson
Reviewed By: #kwin, davidedmundson
Subscribers: ngraham, zzag, davidedmundson, kwin
Tags: #kwin
Differential Revision: https://phabricator.kde.org/D14495
Test Plan: Compiles and the Application Launcher is still sliding.
Reviewers: #kwin, davidedmundson
Reviewed By: #kwin, davidedmundson
Subscribers: kwin
Tags: #kwin
Differential Revision: https://phabricator.kde.org/D14823
Summary:
The existing Data struct has some serious problems:
(a) naming is not intuitive, SlideInterface uses more cleaner terminology
so let's use that (and because Wayland is the future);
(b) fadeInTime and fadeOutTime should be slideInDuration and slideOutDuration
respectively. The Sliding popups effect doesn't fade windows, it slides
them;
(c) mWindowsData should be m_animationsData because other parts of this
effect refer to it as "anim data"(e.g. setupAnimData).
This effect uses its own Location enum class instead of KWayland::
Server::SlideInterface::Location because it would be better to not
depend on platform specific data structures.
As a side effect, this change also fixes QHash abuse. The Sliding popups
effect is still hashing windows twice in prePaintWindow and paintWindow.
But I think that's acceptable because usually there would be only one
active sliding window.
CCBUG: 331118
Reviewers: #kwin, davidedmundson
Reviewed By: #kwin, davidedmundson
Subscribers: davidedmundson, kwin
Tags: #kwin
Differential Revision: https://phabricator.kde.org/D14301
Summary:
Slided popups are clipped twice:
* first, when filtering window quads in prePaintWindow;
* then, when doing scissor test (the opengl scene plugin does scissor
test for transformed windows).
Because of that, we don't need to filter window quads. Filtering window
quads only adds overhead.
This change simplifies code and "fixes" incorrect clipping when a slided
popup has shadows.
Test Plan:
* Put Plasma panel on the left screen edge;
* Open and close the Application Launcher.
(repeat for top/right/bottom screen edge)
Reviewers: #kwin, davidedmundson
Reviewed By: #kwin, davidedmundson
Subscribers: davidedmundson, graesslin, kwin
Tags: #kwin
Differential Revision: https://phabricator.kde.org/D14450
Summary:
Weston does something similar
https://cgit.freedesktop.org/wayland/weston/tree/libweston/compositor-fbdev.c#n315
...and it seems that the non-primary framebuffer devices start completely off. (the screen is off on my Displayport device, and the window for the second vga card in qemu is much smaller than the primary one, and all black for my qemu vm) .
In my testing, sending the ioctl FBIOPUT_VSCREENINFO with a *changed* &varinfo allows it to wake up, and turns on the screen.
doing FBIOGET_VSCREENINFO and then FBIOPUT_VSCREENINFO in my testing does not work.
I think really the values that end up getting changed are varinfo.transp.offset and varinfo.transp.length. at least on the qemu system, but in this patch I am aligning all of them for completeness, because the drivers might do it differently for qemu
Test Plan: This causes the window for /dev/fb1 (remote-viewer, and a qemu vm with two "VGA" (bochsdrm) cards) to resize from the smaller size when specifying it as the --fb-device on seat0, and kwin draws on the device.
Reviewers: #kwin, davidedmundson, graesslin
Reviewed By: #kwin, graesslin
Subscribers: zzag, davidedmundson, rkflx, graesslin, kwin
Tags: #kwin
Differential Revision: https://phabricator.kde.org/D9572
Summary:
* Use new connect syntax
* Fix coding style
* Port to TimeLine
* Delete unused includes
* Use interpolate helper
* Drop WindowInfo class
Behavior of this effect hasn't been changed.
Test Plan: Opened/closed an "Open File" dialog, it still flies in/out.
Reviewers: #kwin, davidedmundson
Reviewed By: #kwin, davidedmundson
Subscribers: davidedmundson, anthonyfieroni, kwin
Tags: #kwin
Differential Revision: https://phabricator.kde.org/D14685
Summary:
It's superseded by the new scale effect(D13461).
Existing users of this effect will be migrated to the new scale effect.
Depends on D13461
Reviewers: #kwin, #plasma, #vdg, davidedmundson
Reviewed By: #kwin, davidedmundson
Subscribers: davidedmundson, kwin
Tags: #kwin
Differential Revision: https://phabricator.kde.org/D13462
Summary:
The new effect scales windows as they appear and disappear.
As the the most of window animation effects, it is a monolithic effect,
i.e., if you enable scale effect, it will animate *both* the appearing and
disappearing.
The main difference between the Scale effect and the Scale in effect is
that the Scale in effect only animates windows as they appear. There is
no corresponding "the Scale out" effect, which is odd. Other points that
differentiate the Scale effect from the Scale in effect:
* it is more subtle;
* it doesn't animate the log out screen;
* it doesn't conflict with the Fade effect, etc.
... and overall, the Scale effect supersedes the Scale in effect.
{F5904947}
//Window open animation.//
{F5904948}
//Window close animation.//
{F5905283, layout=center, size=full}
//KCM.//
Test Plan:
* Enabled this effect
* Opened/closed System Settings
Reviewers: #kwin, #plasma, #vdg, davidedmundson
Reviewed By: #kwin, #plasma, #vdg, davidedmundson
Subscribers: ngraham, davidedmundson, fvogt, kwin
Tags: #kwin
Differential Revision: https://phabricator.kde.org/D13461
Summary:
The Glide effect should not animate the Application Dashboard because
it's not an ordinary application or a dialog. Same applies to Kickoff,
panel popups, etc.
The most obvious solution would be to add "plasmashell plasmashell"
window class to the blacklist, but we still would like to animate some
of plasmashell's windows, for example, Empty Trash Bin confirmation
dialog (if the trash bin icon is on the desktop).
One could notice that the Empty Trash Bin confirmation dialog, Task
Manager Settings window, and other plasmashell's windows that we want
to animate have decorations. So, we can use that as a heuristic.
Test Plan: Opened/closed the Application Dashboard.
Reviewers: #kwin, davidedmundson
Reviewed By: #kwin, davidedmundson
Subscribers: davidedmundson, abetts, kwin
Tags: #kwin
Differential Revision: https://phabricator.kde.org/D14367
Summary:
If a modal window is near some of screen edges, it will be distorted
in undesired way when it's being animated.
In order to keep perspective distortions invariant, no matter where
the modal window is on the screen, we have to move that modal window
to the origin, scale it, rotate it, translate it, apply perspective projection,
and then move it back.
Test Plan:
* Opened Kate
* Opened "Open File" dialog (during the in animation, it was distorted as expected)
* Closed that dialog (during the out animation, it was distorted as expected)
Reviewers: #kwin, davidedmundson
Reviewed By: #kwin, davidedmundson
Subscribers: davidedmundson, kwin
Tags: #kwin
Differential Revision: https://phabricator.kde.org/D14687
Summary:
If both the Glide effect and the Sheet effect are enabled,
they will conflict. Expected behavior would be:
* the Sheet effect animates only modal windows;
* the Glide effect animates the rest of normal windows.
In order to resolve the conflict, the Sheet effect has to grab
modal windows. Because it's quite specialized effect, we have
to ignore whether modal windows have been grabbed by the
Glide effect.
Test Plan:
* Enabled both the Glide effect and the Sheet effect;
* Opened Kate;
* Opened "Open file" dialog;
* Closed the dialog.
Reviewers: #kwin, davidedmundson
Reviewed By: #kwin, davidedmundson
Subscribers: abetts, davidedmundson, kwin
Tags: #kwin
Differential Revision: https://phabricator.kde.org/D14560
Summary:
One cannot use a non metatype frrom an external class inside an
invokable. https://bugreports.qt.io/browse/QTBUG-58454
End result is the script engine arguments wouldn't match up and MOC
would just use the default value.
As far as I can tell this has been broken for 6 years.
The global animate method that unboxes a QJSValue as an object is
unaffected.
No shipped kwin effect actually used it.
To some extent we didn't even actually want to enforce the enum as we
also accept custom value of ScriptedEffect::GuassianCurve, so it has
been switched for an int.
Test Plan: Unit test
Reviewers: #kwin, broulik
Reviewed By: broulik
Subscribers: kwin
Tags: #kwin
Differential Revision: https://phabricator.kde.org/D14669
Summary:
Currently, the fade effect animates both the appearing and the
disappearing of the logout screen. We don't want that because
the logout effect should do that.
D14582 addresses that problem by adding "ksmserver ksmserver" window
class to the blacklist of the fade effect. With that change, only the
logout effect animates the appearing of the logout screen. But there is
a problem... If user clicks the cancel button, the logout screen
instantaneously disappears, instead of smoothly fading out.
This change addresses that problem by adding "out" animation.
Depends on D14582
Test Plan:
{F6175011}
//Now, only the logout effect animates the appearing and the disappearing of the logout screen.//
{F6175013}
//No smooth transitions when the logout effect is disabled.//
Reviewers: #kwin, #plasma, #vdg, davidedmundson
Reviewed By: #kwin, #plasma, davidedmundson
Subscribers: kwin
Tags: #kwin
Differential Revision: https://phabricator.kde.org/D14592
Summary:
The kwin code was written to treat scale as non integers, we just need
to switch to the relevant float version of methods.
Test Plan:
Used kscreen-doctor to change this
Konsole resized as appropriate
Plasmashell was all broken, but that's expected until QScreen::size is based on the
xdg-output virtual size
Reviewers: #kwin, mart, graesslin, romangg
Reviewed By: #kwin, mart, graesslin
Subscribers: romangg, zzag, kwin
Tags: #kwin
Differential Revision: https://phabricator.kde.org/D13616