Bug 352050 - Moving windows between monitors is stuttering badly when side screen tiling is enabled.
Summary: Moving windows between monitors is stuttering badly when side screen tiling i...
Status: RESOLVED FIXED
Alias: None
Product: kwin
Classification: Plasma
Component: general (show other bugs)
Version: 5.4.0
Platform: Arch Linux Linux
: NOR normal
Target Milestone: ---
Assignee: KWin default assignee
URL: https://git.reviewboard.kde.org/r/125...
Keywords:
: 354967 (view as bug list)
Depends on:
Blocks:
 
Reported: 2015-08-31 06:32 UTC by Artur O.
Modified: 2016-03-15 05:42 UTC (History)
1 user (show)

See Also:
Latest Commit:
Version Fixed In: 5.5
thomas.luebking: ReviewRequest+


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Artur O. 2015-08-31 06:32:37 UTC
When side screen tiling is enabled moving windows between monitors is stuttery. Seems the effect triggers the slowdown. Non compositing mode seems not to suffer from the stuttering other than the other issues with slow moving that was introduced lately (but that's another bug)
(tested with Nvidia drivers 355.06)
Comment 1 Thomas Lübking 2015-08-31 07:04:28 UTC
I frankly doubt this will fix unless we abandon the QtQuick outline window in the composited case.

What could be possible to mitigate the problem would be to delay ::setElectricBorderMaximizing() ie. set a state and bump a 250ms timer (so that the showing will simply not occur on rather fast movements)
Comment 2 Martin Flöser 2015-08-31 07:19:44 UTC
what might improve is getting a shared QQmlEngine for our stuff, so that it's not recreated on each show.
Comment 3 Thomas Lübking 2015-08-31 07:29:41 UTC
void CompositedOutlineVisual::show()
{
    if (m_qmlContext.isNull()) {
        m_qmlContext.reset(new QQmlContext(Scripting::self()->qmlEngine()));
        m_qmlContext->setContextProperty(QStringLiteral("outline"), outline());
    }


Looks like
a) the engine is shared
b) it's only recreated on compositing chages at best anyway

I had assumed the problem was with actually mapping the QtQuick GL context (maybe QtQuick internally deletes the context and recreates it on mapping only)
Comment 4 Martin Flöser 2015-08-31 07:43:26 UTC
oh right, it's already shared.

What might be more a problem are:

void CompositedOutlineVisual::hide()
{
    if (QQuickWindow *w = qobject_cast<QQuickWindow*>(m_mainItem.data())) {
        w->hide();
        w->destroy();
    }
}

Which basically causes the window to be destroyed on each hide. I remember to have added that because of issues with the free driver stack (totally didn't update). Maybe that's not an issue with nvidia and we can make that a driver specific check. I'll also try whether this is needed at all nowadays.
Comment 5 Martin Flöser 2015-08-31 07:44:56 UTC
> I'll also try whether this is needed at all nowadays.

oh yes, that's still needed at least on Intel.
Comment 6 Thomas Lübking 2015-08-31 08:06:59 UTC
Just as well on nvidia  - the problem is rather in QtQuick than in the driver stack (mind eg. the artifacts on the +/- desktop grid buttons)

We could go for that silly hide-is-move approach from the effect buttons, but in this case I assume just blending away invocation is the more elegant <s>solution</s> workaround.


However, tbh. atm. I'm personally in favor to remove all QtQuick bits of this kind for it's apparently neither designed nor suited for this kind of short-term invocation.

Eg. the effect buttons could be unstyled effect frames (since we grab input anyway) what costs nothing - and a translucent unstyled effect frame would actually not make any visual difference from the outline appearance of the "breeze dark" theme :-P

Not sure about the tabbox, though. We could use scripting to position box and icons/labels/thumbnails, but QtScript is deprecated and I/we don't know yet how much portable client code will be reg. QJSEngine.
Comment 7 Martin Flöser 2015-08-31 08:55:23 UTC
well moving away from QtQuick means that we make theming more difficult. One of the thoughts I had in mind with QtQuick was making it easy for e.g. LXQt to use KWin without having to depend on Plasma's visuals.

On Wayland btw. the whole thing looks much better which makes me think it might also be related to the way Qt uses xcb - especially if one considers stuff like https://git.reviewboard.kde.org/r/124948/
Comment 8 Martin Flöser 2015-08-31 09:00:29 UTC
oh and something to also look into: share context. On Wayland it's super awesome as we can share the context with the compositor and just render into a FBO and use that as the window texture. If we could get that to work for X11 as well, we might get rid of all the problems as we just bypass the async XCB.

But I so far failed to make the context sharing and especially it cannot work if one is GLX and the other EGL (or the other way around).
Comment 9 Thomas Lübking 2015-08-31 14:15:34 UTC
Neither on xrender nor uncomposited - however it would certainly an improvement (hopefully)
Tried https://forum.qt.io/topic/24701/solved-creating-a-qquickview-with-a-shared-opengl-context/5 ?

On theming, I had simply gone for a theme agnostic OSD design (since we "have" to use it in som places due to readability issues anyway)
Comment 10 Martin Flöser 2015-08-31 14:37:30 UTC
I had tried something like that. The problem was that the QOpenGLContext for our compositing context and the QOpenGLContext for QtQuick just didn't want to share. It was somehow related to the way we create the context and Qt creates the context. As it worked for Wayland now the issue might have been fixed with Qt 5.4. Maybe I should get out the old branch ;-)
Comment 11 Thomas Lübking 2015-09-14 20:07:52 UTC
Git commit 3a1f11d21347032f7d1b8fd43d30ee7d3ce5ede0 by Thomas Lübking.
Committed on 14/09/2015 at 19:02.
Pushed by luebking into branch 'master'.

delay QuickTiling indication on inner screenborder

The user might just want to move the window from
one screen to another, no point in wasting time to
show the indicator
REVIEW: 125024
FIXED-IN: 5.5

M  +1    -0    client.cpp
M  +1    -0    client.h
M  +29   -8    events.cpp

http://commits.kde.org/kwin/3a1f11d21347032f7d1b8fd43d30ee7d3ce5ede0
Comment 12 Thomas Lübking 2015-11-06 23:19:00 UTC
*** Bug 354967 has been marked as a duplicate of this bug. ***
Comment 13 Artur O. 2016-03-14 08:04:43 UTC
(In reply to Thomas Lübking from comment #11)
> Git commit 3a1f11d21347032f7d1b8fd43d30ee7d3ce5ede0 by Thomas Lübking.
> Committed on 14/09/2015 at 19:02.
> Pushed by luebking into branch 'master'.
> 
> delay QuickTiling indication on inner screenborder
> 
> The user might just want to move the window from
> one screen to another, no point in wasting time to
> show the indicator
> REVIEW: 125024
> FIXED-IN: 5.5
> 
> M  +1    -0    client.cpp
> M  +1    -0    client.h
> M  +29   -8    events.cpp
> 
> http://commits.kde.org/kwin/3a1f11d21347032f7d1b8fd43d30ee7d3ce5ede0

Hm im running on Arch and it seems that Windows still stutter when its enabled.
Comment 14 Thomas Lübking 2016-03-14 10:43:10 UTC
How fast do you move windows?
You'll have 250ms to get it across the active area (20px on either side of the edge) - otherwise the indicator is still created.
Comment 15 Artur O. 2016-03-14 17:28:41 UTC
(In reply to Thomas Lübking from comment #14)
> How fast do you move windows?
> You'll have 250ms to get it across the active area (20px on either side of
> the edge) - otherwise the indicator is still created.

Not so slow, just a regular drag; here is a video I tried to do: https://www.youtube.com/watch?v=Exa8UwPiP1U&feature=youtu.be 

There is no indicator shown etc but it still feels and shows the stutter when dragging.

Best Regards
Comment 16 Thomas Lübking 2016-03-14 18:45:00 UTC
the video is marked private.
you can also attach it here or send it by mail
Comment 17 Artur O. 2016-03-15 05:42:46 UTC
(In reply to Thomas Lübking from comment #16)
> the video is marked private.
> you can also attach it here or send it by mail

Oh sorry confused it with unlisted, its fixed now.
Comment 18 Artur O. 2016-03-15 05:42:58 UTC
(In reply to Thomas Lübking from comment #16)
> the video is marked private.
> you can also attach it here or send it by mail

Oh sorry confused it with unlisted, its fixed now.