Commit Graph

16448 Commits (8d0554e45a8f8628b8b4dd233d983a3a4f1a6562)

Author SHA1 Message Date
Vlad Zagorodniy 8d0554e45a [scripting] Allow effects to grab windows
Summary:
Some JavaScript based effects need to grab particular windows in order
to avoid conflicts with other effects.

Example usage:

```lang=js
effects.windowAdded.connect(function (window) {
    if (effect.grab(window, Effect.WindowAddedGrabRole)) {
        window.coolWindowTypeAnimation = animate({
            ...
        });
    }
});
```

Reviewers: #kwin, davidedmundson

Reviewed By: #kwin, davidedmundson

Subscribers: romangg, graesslin, davidedmundson, kwin

Tags: #kwin

Differential Revision: https://phabricator.kde.org/D13153
2018-10-29 10:17:21 +02:00
Vlad Zagorodniy 6c5d7ef2ad Merge branch 'Plasma/5.14' 2018-10-29 00:03:16 +02:00
Vlad Zagorodniy 8fa1537d6f Merge branch 'Plasma/5.12' into Plasma/5.14 2018-10-29 00:02:52 +02:00
Erik Kurzinger 4348cd5683 [effects/presentwindows] Avoid potential freeze during fill-gaps
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
2018-10-29 00:02:21 +02:00
David Edmundson fe07909cd8 [desktopchangeosd] Sync desktop switch OSD font size to Plasma OSD font size
Summary:
Plasma's OSDs for volume/screens etc use PlasmaExtras.Heading, this
should to.

Also correct centering text to constrain the text element and align the
text within that bounding box. Previous code could have overflown in the
event of a really really long desktop name if we're resizing to the
grid.

BUG: 356600

Test Plan:
Switched desktop with OSD on
Tried with and without "show desktop layout indicators"

Reviewers: #kwin, graesslin

Reviewed By: #kwin, graesslin

Subscribers: kwin

Tags: #kwin

Differential Revision: https://phabricator.kde.org/D16420
2018-10-28 16:46:50 +00:00
Frederik Gladhorn 951dfd1036 Minor grammar fixup in comment 2018-10-28 12:52:26 +01:00
Frederik Gladhorn 7d1d28ea2c Remove extra semicolon 2018-10-28 12:52:19 +01:00
l10n daemon script 5d22ad68c8 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"
2018-10-28 07:03:31 +01:00
l10n daemon script 8d5bb96bdb 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"
2018-10-28 04:59:42 +01:00
Vlad Zagorodniy c08279873d Merge branch 'Plasma/5.14' 2018-10-27 19:10:37 +03:00
Vlad Zagorodniy 00c9b4c1c9 [effects/thumbnailaside] Save shortcuts
Summary:
If user selects a shortcut to trigger the effect, that shortcut won't
work after the KCM is closed because we don't save it.

BUG: 400351
FIXED-IN: 5.14.3

Test Plan:
* Specified custom shortcut to trigger the effect;
* Closed the KCM;
* Pressed the shortcut, a thumbnail appeared.

Reviewers: #kwin, graesslin

Reviewed By: #kwin, graesslin

Subscribers: kwin

Tags: #kwin

Differential Revision: https://phabricator.kde.org/D16456
2018-10-27 19:09:49 +03:00
l10n daemon script f03b2a4baa 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"
2018-10-27 05:56:01 +02:00
Vlad Zagorodniy 722af02153 [effects] Recreate shell client connections after compositor settings have been changed
Summary:
If the animation speed was changed, then EffectsHandler will be destroyed
and created again.

Because we don't create connections to monitor state of Wayland clients
in EffectsHandler constructor, effects like the Magic lamp won't work
after changing compositor settings.

BUG: 400240

Test Plan:
* Changed animation speed;
* Minimized a Wayland client.

Reviewers: #kwin, davidedmundson

Reviewed By: #kwin, davidedmundson

Subscribers: kwin

Tags: #kwin

Differential Revision: https://phabricator.kde.org/D16401
2018-10-26 14:48:34 +03:00
David Edmundson 110fa039cb Use consistent size icon in OSD
Summary:
The OSD's icon is based on the implicitSize of the IconItem.

For most icons this will be a hardcoded value from
KIconLoader::global()->currentSize

However, since bc33f0470d4d6bcbf30475f85b36705e8a99528b in
plasma-framework we sometimes return that value, sometimes will return the
source size of the underlying image depending on internal paths of how
the icon is loaded and whether it was in the plasma theme or not.

This patch overrides the implicitWidth given to the layout to be the
standard icon size.

BUG: 400083

Test Plan:
Loaded the force kill window OSD.
Icon still looked the same size on breeze.

I didn't reproduce the issue in the bug

Reviewers: #kwin, graesslin

Reviewed By: #kwin, graesslin

Subscribers: kwin

Tags: #kwin

Differential Revision: https://phabricator.kde.org/D16432
2018-10-26 12:13:50 +01:00
Vlad Zagorodniy a60edb503e Merge branch 'Plasma/5.14' 2018-10-26 11:31:37 +03:00
Vlad Zagorodniy e4c399a635 Merge branch 'Plasma/5.12' into Plasma/5.14 2018-10-26 11:30:59 +03:00
Erik Kurzinger 408ed80604 [effects/desktopgrid] Specify screen projection matrix when drawing moving window
Summary:
Currently, when the user is moving a window in the desktop grid it is drawn from
the paintScreen function to ensure it appears above all other windows. However,
when drawing the window, the screenProjectionMatrix for the WindowPaintData structure
is never specified. Because of this, the window will not be visible if OpenGL
compositing along with Lanczos scaling are in use since its coordinates will never
be projected into screen-space (unless the window is maximized, in which case the
scaling code is bypassed).

BUG: 361371
BUG: 364509

FIXED-IN: 5.14.3

Test Plan:
Ensure OpenGL compositing is enabled and the scaling method is set to "Accurate" on
hardware supporting this option. Additionally, ensure the desktop grid effect is
active and is configured to use Present Windows. Open a window and ensure is it not
maximized. Click on the window and drag it around - its contents should remain visible
the entire time and follow the mouse.

Reviewers: #kwin, zzag, graesslin, davidedmundson

Reviewed By: #kwin, zzag, davidedmundson

Subscribers: broulik, davidedmundson, kwin, #kwin

Tags: #kwin

Differential Revision: https://phabricator.kde.org/D16430
2018-10-26 11:30:39 +03:00
Vlad Zagorodniy d9eb0e7707 Merge branch 'Plasma/5.14' 2018-10-26 11:20:33 +03:00
Erik Kurzinger 91b538105a [effects/desktopgrid] Specify screen projection matrix when drawing moving window
Summary:
Currently, when the user is moving a window in the desktop grid it is drawn from
the paintScreen function to ensure it appears above all other windows. However,
when drawing the window, the screenProjectionMatrix for the WindowPaintData structure
is never specified. Because of this, the window will not be visible if OpenGL
compositing along with Lanczos scaling are in use since its coordinates will never
be projected into screen-space (unless the window is maximized, in which case the
scaling code is bypassed).

BUG: 361371
BUG: 364509

FIXED-IN: 5.14.3

Test Plan:
Ensure OpenGL compositing is enabled and the scaling method is set to "Accurate" on
hardware supporting this option. Additionally, ensure the desktop grid effect is
active and is configured to use Present Windows. Open a window and ensure is it not
maximized. Click on the window and drag it around - its contents should remain visible
the entire time and follow the mouse.

Reviewers: #kwin, zzag, graesslin, davidedmundson

Reviewed By: #kwin, zzag, davidedmundson

Subscribers: broulik, davidedmundson, kwin, #kwin

Tags: #kwin

Differential Revision: https://phabricator.kde.org/D16430
2018-10-26 11:19:13 +03:00
Laurent Montel 2043161889 Remove unused check 2018-10-25 08:05:13 +02:00
l10n daemon script 51b0dfbf17 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"
2018-10-25 07:53:41 +02:00
l10n daemon script c3b51dcbdc 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"
2018-10-25 06:01:19 +02:00
l10n daemon script c7aa721273 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"
2018-10-24 08:42:22 +02:00
l10n daemon script 26a8892d9d 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"
2018-10-24 08:15:36 +02:00
l10n daemon script 9ba26510d0 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"
2018-10-24 06:05:03 +02:00
Vlad Zagorodniy 7b19fa87d0 [libkwineffects] Delete unused field in AniData
Summary: windowType is not used anywhere so delete it.

Test Plan: Compiles.

Reviewers: #kwin, davidedmundson

Reviewed By: #kwin, davidedmundson

Subscribers: kwin

Tags: #kwin

Differential Revision: https://phabricator.kde.org/D16389
2018-10-23 18:25:44 +03:00
Vlad Zagorodniy eb78b1ca3a [effects] Re-implement the Minimize Animation effect in JavaScript
Summary:
There were several reasons to rewrite the Minimize Animation effect in
JavaScript: to simplify code and to get rid of full repaints. One could
say that nothing prevents us from calculating the dirty region in
postPaintScreen or postPaintWindow and it is correct, but with the
scripting effects API the dirty region will be calculated for us, so we
can focus more on "what we want" instead of "how".

Visually, the "old" effect and the rewritten one look quite the same.
Except one tiny bit: if a window doesn't have an icon in the task manager,
it won't be animated. The reason for that is the purpose of this effect is
to show where the window will be after it's minimized, if the window
doesn't have icon in the task manager, one can't click at the center of
the screen to unminimize the window.

There is one significant change, the name of the effect was changed to
"Squash". If we put this effect and the Magic lamp effect under "Window
Minimize Animation" category (or if we add some "heading" label), then
the old name and the name of the category would "conflict". The new name
was suggested by Nate Graham and it very closely describes what the
effect does. "Scale" doesn't fit this effect because while a window is
being animated, its aspect ratio is not preserved.

Reviewers: #kwin, #plasma, davidedmundson

Reviewed By: #kwin, #plasma, davidedmundson

Subscribers: davidedmundson, kwin

Tags: #kwin

Differential Revision: https://phabricator.kde.org/D16372
2018-10-23 16:57:07 +03:00
Vlad Zagorodniy c32ffcab46 Merge branch 'Plasma/5.14' 2018-10-23 16:50:12 +03:00
David Edmundson bdf348c603 [wayland] Set better placement for XDG Toplevels
Summary:
XDG Popups will have a transient parent and positional information.
XDG Toplevels can have a transient parent without having positional
information.

Currently we set that we have a transient placement hint of 0,0 which
means the newly opened children go to the top left of the parent.

This new code paths treat child top levels as dialogs centering them to
the parent.

BUG: 393167

Test Plan:
Dolphin help->about
Appeared where it does on X

Reviewers: #kwin, zzag

Reviewed By: #kwin, zzag

Subscribers: zzag, kwin

Tags: #kwin

Differential Revision: https://phabricator.kde.org/D16293
2018-10-23 12:37:10 +01:00
Vlad Zagorodniy 9fae2f4905 [effects/invert] Don't block blur and background contrast effect
Summary:
Background behind some windows is not blurred because the invert effect
sets PAINT_WINDOW_TRANSFORMED. This essentially "turns off" the blur and
the background contrast effect unless we set the force roles.

Because the invert effect is a "post-processing"(not really) effect we
don't have to set that flag.

BUG: 279076
BUG: 359583
FIXED-IN: 5.14.3

Test Plan: {F6341916}

Reviewers: #kwin, davidedmundson

Reviewed By: #kwin, davidedmundson

Subscribers: kwin

Tags: #kwin

Differential Revision: https://phabricator.kde.org/D16358
2018-10-23 13:57:56 +03:00
Bhushan Shah 69af30f3fb Update version number for 5.14.2
GIT_SILENT
2018-10-23 16:06:41 +05:30
Vlad Zagorodniy 655d8af8be [libkwineffects] Delete unused constant
Summary:
The constant is a leftover after
2569768074.

Test Plan: Compiles.

Reviewers: #kwin, davidedmundson

Reviewed By: #kwin, davidedmundson

Subscribers: kwin

Tags: #kwin

Differential Revision: https://phabricator.kde.org/D16373
2018-10-22 18:27:22 +03:00
Vlad Zagorodniy 57f313e500 [effects/sheet] Decrease the default animation duration
Summary:
For some historical reasons, the sheet effect uses animation duration of
500ms. In comparison to other effects that animate the appearing and the
disappearing of windows, 500ms is too high value for the duration.

As the title says, this change decreases the default animation duration
to 300ms. The new duration is more saner.

The opacity is animated to make the effect look smoother with the
shorter animation duration.

BUG: 400021
FIXED-IN: 5.15.0

Reviewers: #kwin, graesslin

Reviewed By: #kwin, graesslin

Subscribers: kwin

Tags: #kwin

Differential Revision: https://phabricator.kde.org/D16359
2018-10-22 10:11:00 +03:00
l10n daemon script bb16fe18aa 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"
2018-10-22 07:53:29 +02:00
l10n daemon script 94a4675e63 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"
2018-10-22 06:00:59 +02:00
David Edmundson 8ef363cc21 [wayland] XdgPopup Positioning
Summary:
Support XDGShell Positioning. This gives a client a lot more control
over where the popup will be placed as well as control over how to
handle constraints. i.e what to do if the popup doesn't fit.

trasientOffset was replaced with a method on the client as semantically
it's the role of the client to handle constraints.

Both slide and flip constraint adjustments are implemented. Resize
constraint adjustment will be handled in a future patch.

WlShell is handled by treating it as 1x1 sized anchor with slide
constraint adjustment.

Test Plan:
Manual test of a client implementing xdgpopup exists in kwayland
Extensive unit test here

Existing WlShell test passes (after D16314 which fixes the original)
XdgPopup has a new unit test suite against manually calculated values

Reviewers: #kwin, graesslin

Reviewed By: #kwin, graesslin

Subscribers: zzag, kwin

Tags: #kwin

Differential Revision: https://phabricator.kde.org/D16325
2018-10-20 17:17:59 +01:00
David Edmundson d70c3568e6 [wayland] Fix Placement::placeTransient keeping screens in bound.
Summary:
If a window flows off the left, we move left of the popup to the left
edge of the screen.

Currently if a window flows off the right, we move the window back by
it's own width, leaving it floating at a random point.
For consistency we should be setting it so the right edge of the popup is on the right
edge of the screen.

So in the auto test for the "right border" case:
The screen is 1280 wide, and we open a 10px popup at 1279  the final X
should be 1270.

Test Plan: Unit test

Reviewers: #kwin, zzag, graesslin

Reviewed By: #kwin, zzag, graesslin

Subscribers: zzag, kwin

Tags: #kwin

Differential Revision: https://phabricator.kde.org/D16314
2018-10-20 17:17:58 +01:00
Erik Kurzinger 30ad58f559 [effects/presentwindows] Avoid potential freeze during fill-gaps
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
2018-10-20 18:37:45 +03:00
l10n daemon script 8cd7c5e2c7 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"
2018-10-20 07:59:53 +02:00
l10n daemon script b0a2b69a2d 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"
2018-10-20 06:05:01 +02:00
Vlad Zagorodniy 8063740efb [effects/translucency] Make inactive Wayland clients translucent
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
2018-10-19 18:24:47 +03:00
Vlad Zagorodniy 4e545f5594 [effects/dimscreen] Make it work on Wayland
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
2018-10-19 17:49:37 +03:00
Vlad Zagorodniy 9f3a447a43 [effects/diminactive] Dim Wayland clients
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
2018-10-19 14:38:10 +03:00
Vlad Zagorodniy ab5d66dc0f [effects/diminactive] Fix false-triggering of the out animation
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
2018-10-18 19:27:01 +03:00
Vlad Zagorodniy 984727ad93 [effects] Add plasmashell to the blacklist of Glide and Scale effect on Wayland
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
2018-10-18 19:18:03 +03:00
Vlad Zagorodniy 8f14a00e88 [effects/wobblywindows] Delete commented code
Test Plan: Compiles.

Reviewers: #kwin, davidedmundson

Reviewed By: #kwin, davidedmundson

Subscribers: kwin

Tags: #kwin

Differential Revision: https://phabricator.kde.org/D16260
2018-10-18 19:17:13 +03:00
Vlad Zagorodniy 899bd4de3f [effects/backgroundcontrast] Use override keyword
Test Plan: Compiles.

Reviewers: #kwin, davidedmundson

Reviewed By: #kwin, davidedmundson

Subscribers: kwin

Tags: #kwin

Differential Revision: https://phabricator.kde.org/D16262
2018-10-18 19:16:17 +03:00
Vlad Zagorodniy a1bc918d34 [effects/coverswitch] Use override keyword
Test Plan: Compiles.

Reviewers: #kwin, davidedmundson

Reviewed By: #kwin, davidedmundson

Subscribers: kwin

Tags: #kwin

Differential Revision: https://phabricator.kde.org/D16264
2018-10-18 19:15:13 +03:00
l10n daemon script ea0f2e2d7c 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"
2018-10-17 06:38:09 +02:00
Vlad Zagorodniy d014f2ab74 [effects/screenshot] Use override keyword
Test Plan: Compiles.

Reviewers: #kwin, davidedmundson

Reviewed By: #kwin, davidedmundson

Subscribers: davidedmundson, kwin

Tags: #kwin

Differential Revision: https://phabricator.kde.org/D16261
2018-10-17 02:39:53 +03:00