Commit Graph

13 Commits (4ce853e8e4d3a50788fa43f196247af755c39d19)

Author SHA1 Message Date
Vlad Zahorodnii 4ce853e8e4 Prettify license headers 2020-08-07 19:57:56 +00:00
Vlad Zahorodnii 1fb9f6f13a Switch to SPDX license markers
The main advantage of SPDX license identifiers over the traditional
license headers is that it's more difficult to overlook inappropriate
licenses for kwin, for example GPL 3. We also don't have to copy a
lot of boilerplate text.

In order to create this change, I ran licensedigger -r -c from the
toplevel source directory.
2020-08-07 19:57:56 +00:00
Vlad Zahorodnii d1b35f306d Introduce started signal in Application
The new signal is emitted when the Application has fully been initialized.

It allows us to change the startup sequence, for example create workspace
before starting the Xwayland server, without making any adjustments in our
test suit.
2020-07-17 09:10:51 +00:00
Aleix Pol 3a9d7a6e9d Port KWin to KWaylandServer
Summary: Away from KWayland::Server and KF5WaylandServer.

Test Plan: Builds, ran nested session

Reviewers: #kwin, #plasma, #frameworks, davidedmundson, zzag

Reviewed By: #kwin, #plasma, davidedmundson, zzag

Subscribers: zzag, kwin

Tags: #kwin

Differential Revision: https://phabricator.kde.org/D29278
2020-04-30 12:56:08 +02:00
Vlad Zahorodnii be759b7d33 Use AbstractClient instead of XdgShellClient wherever possible
Summary:
Currently, we have only one shell client type - XdgShellClient. We use
it when we are dealing with Wayland clients. But it isn't really a good
idea because we may need to support shell surfaces other than xdg-shell
ones, for example input panel surfaces.

In order to make kwin more extensible, this change replaces all usages
of the XdgShellClient class with the AbstractClient class.

Test Plan: Existing tests pass.

Reviewers: #kwin, davidedmundson

Reviewed By: #kwin, davidedmundson

Subscribers: davidedmundson, kwin

Tags: #kwin

Differential Revision: https://phabricator.kde.org/D27778
2020-03-04 09:57:13 +02:00
Vlad Zahorodnii 55b4912004 Update my email address 2020-01-14 18:17:18 +02:00
Vlad Zahorodnii f93875535c Update my last name 2019-09-29 17:03:25 +03:00
Vlad Zagorodniy 168ea98845 Rename ShellClient to XdgShellClient
Summary:
Rename ShellClient to XdgShellClient in order to reflect that it
represents only xdg-shell clients.

Test Plan: Compiles, tests still pass.

Reviewers: #kwin

Subscribers: kwin

Tags: #kwin

Differential Revision: https://phabricator.kde.org/D23589
2019-09-23 17:28:56 +03:00
Vlad Zagorodniy d92d6e77ae [autotests] Don't test wl-shell clients
Summary:
This change removes all traces of wl-shell in the test suite. That's a
prerequisite for dropping wl-shell support in KWin.

Given that wl-shell and xdg-shell are not interchangeable, some tests
were removed and initialization sequence in some tests was adjusted.

The most notable change is ensuring that each plasmashell window sets
its role and initial position before committing the surface. Setting
those properties before the first surface commit is important because
our window placement code needs to know window type in order to
avoid maximizing panels, popups, etc.

Reviewers: #kwin, davidedmundson

Reviewed By: #kwin, davidedmundson

Subscribers: kwin

Tags: #kwin

Differential Revision: https://phabricator.kde.org/D23561
2019-09-23 17:28:56 +03:00
Martin Flöser 99df3c82f3 [autotests] Don't check whether there is a /dev/dri/card0
Summary:
With EGL_MESA_platform_surfaceless we don't need a dri device anymore.
So we don't need to skip the tests if the device is missing. Instead the
tests verify that OpenGL compositing is used if requested.

Test Plan: ctest passes

Reviewers: #kwin

Subscribers: kwin

Tags: #kwin

Differential Revision: https://phabricator.kde.org/D18014
2019-01-12 07:36:28 +01:00
Vlad Zagorodniy dadcd51135 [scenes/opengl] Fix overlaps in shadow texture atlas
Summary:
If the corner shadow tiles(top-left, top-right, and so on) tiles are missing,
then the left/top/right/bottom shadow tiles will overlap.

This diff addresses that problem by changing how the shadow texture
atlas is rendered:
* corner tiles will be drawn in the corners of the atlas(buildQuads
  method expects them to be at the corners);
* top, right, bottom, and left tile will be aligned to the top-left
  corner of the inner shadow rect.

For majority of desktop themes, the shadow texture atlas looks the same.
For example, here's for Aether:

Before:
{F6190484, layout=center, size=full}

After:
{F6190488, layout=center, size=full}

Depends on D14783

Reviewers: #kwin, davidedmundson

Reviewed By: #kwin, davidedmundson

Subscribers: davidedmundson, abetts, kwin

Tags: #kwin

Differential Revision: https://phabricator.kde.org/D14784
2018-08-31 17:33:19 +03:00
Vlad Zagorodniy 5e55664de8 [scenes/opengl] Correctly draw shadows when corner tiles are missing
Summary:
Current implementation of buildQuads assumes that corner shadow tiles
are always present:

    const QRectF leftRect(
        topLeftRect.bottomLeft(),
        bottomLeftRect.topRight());

but that assumption is wrong. For example, if the default panel is on
the bottom screen edge, then the calendar popup won't have the
bottom-left shadow tile(at least on Wayland). Which means that the left
shadow tile won't be visible because
topLeftRect.left() == bottomLeftRect.right().

Corner rectangles only have to influence height of the left/right tile
and width of the top/bottom tile. Width of the left/right tile and
height of the top/bottom tile should not be controlled by corner tiles.

Overall, this is how shadow quads are computed:

* Compute the outer rectangle;
* Compute target rectangle for each corner tile. If some corner tile is
  missing, move the target rectangle to the corresponding corner of the
  inner shadow rect and set its width and height to 0. We need to do
  that to prevent top/right/bottom/left tiles from spanning over
  corners:

{F6190219, layout=center, size=full}

We would rather prefer something like this if the top-left tile is
missing:
{F6190233, layout=center, size=full}

* Fix overlaps between corner tiles;
* Compute target rectangles for top, right, bottom, and left tiles;
* Fix overlaps between left/right and top/bottom shadow tiles.

Test Plan:
* Ran tests;
* Resized Konsole to its minimimum size(on X11 and Wayland);
* Opened the calendar popup(on X11 and Wayland):

Before:
{F6190344, layout=center, size=full}

After:
{F6190346, layout=center, size=full}

Reviewers: #kwin, davidedmundson

Reviewed By: #kwin, davidedmundson

Subscribers: abetts, davidedmundson, kwin

Tags: #kwin

Differential Revision: https://phabricator.kde.org/D14783
2018-08-31 17:33:19 +03:00
Vlad Zagorodniy 7637cfc22b [scenes/opengl] Fix overlapping shadow tiles
Summary:
This problem appears if shadow corner tiles are too big and
some window has size smaller than 2 * shadowTileSize.

This change tries to address the problem above by exclusing
overlapping tile parts. If there are any two overlapping corners
then tile between them(top/right/bottom/left) is not rendered.

Also, because some corner tile parts can be excluded, corner tiles
are expected to be symmetrical(i.e. if we remove right half from
the top-left tile and left half from the top-right tile and
stick them together, they still look fine, there are no misalignments, etc).
Most shadows(e.g. shadows from Breeze) have such behaviour.

No tiles are overlapping

{F5728514, layout=center, size=full}

Overlapping tiles

{F5728516, layout=center, size=full}

And this is how it supposed to be

{F5728517, layout=center, size=full}

Test Plan:
* apply D11069 to Breeze
* in System Settings/Application Style/Window Decorations, choose "Very Large" shadow size
* open Konsole
* resize it to a minimum possible size

Reviewers: #kwin, graesslin, davidedmundson

Reviewed By: #kwin, davidedmundson

Subscribers: davidedmundson, ngraham, anemeth, abetts, kwin

Tags: #kwin

Differential Revision: https://phabricator.kde.org/D10811
2018-06-07 12:07:57 +03:00