Commit graph

15 commits

Author SHA1 Message Date
Vlad Zahorodnii
93e0265e4e Move source code to src/ directory
Once in a while, we receive complaints from other fellow KDE developers
about the file organization of kwin. This change addresses some of those
complaints by moving all of source code in a separate directory, src/,
thus making the project structure more traditional. Things such as tests
are kept in their own toplevel directories.

This change may wreak havoc on merge requests that add new files to kwin,
but if a patch modifies an already existing file, git should be smart
enough to figure out that the file has been relocated.

We may potentially split the src/ directory further to make navigating
the source code easier, but hopefully this is good enough already.
2021-02-10 15:31:43 +00:00
Vlad Zahorodnii
9acf04e2b7 Refactor Toplevel::opacity
The major difference between this version and the previous is that kwin
no longer forwards the opacity to the app window if it runs as a
window window manager and a compositing manager. As Keith Packard said [1]

> The window manager support is only needed to forward the property from the
> application window to the frame; with the Composite extension, a
> compositing manager can then take that value into account when
> constructing the desktop image.  Any X server can implement the Composite
> extension; the one in the X server project at freedesktop.org is just one
> such.  It would be trivial to implement this extension in a direct FB
> based X server, or any other X server which places windows in off-screen
> images.

There are a couple of reasons to do so: (a) simplifies code, (b) we don't
temper with opacities on override-redirect windows.

[1] https://listman.redhat.com/archives/xdg-list/2003-December/msg00153.html
2021-02-06 11:13:36 +02:00
Vlad Zahorodnii
7995112550 Change type of opacity to qreal
The rest of code assumes that it's qreal.
2021-02-06 00:42:44 +02:00
Vlad Zahorodnii
e398a7cd1a Drop Toplevel::windowId()
A window id generated by WaylandServer may reference an X11 window
with the same id, which can result in undefined behavior.

The main reason why we needed windowId() was because of the task
switcher. However, since tabbox uses internal ids now, the window id
property can be dropped.
2020-11-10 09:58:07 +00:00
Vlad Zahorodnii
790ddc0909 Remove WaylandClient::isInputMethod()
We assume that the input method server has at most one surface at a time,
which corresponds to the virtual keyboard. But it's not guaranteed to be
always true.

For example, an xdg_toplevel surface can be created for a configuration
dialog, in which case isInputMethod() should not return true.
2020-09-04 06:47:38 +00:00
Vlad Zahorodnii
d3cca65d39 Implement the layer-shell v1 protocol
The layer-shell protocol allows wayland clients to create surfaces that
can be used for building desktop environment components such as panels,
notifications, etc.

The support for the plasma-shell protocol will be dropped once plasma in
all its entirety is ported to the layer-shell protocol.
2020-09-03 18:11:44 +00:00
Vlad Zahorodnii
7be4ab97e4 Move XdgSurfaceClient::cleanTabBox() to WaylandClient
It can be useful for other Wayland clients as well.
2020-09-03 18:11:44 +00:00
Vlad Zahorodnii
fde34f3c57 Introduce geometry sync mode flags
The sync mode flags indicate in which fashion position and size update
are made, i.e. synchronous or asynchronous.
2020-09-03 18:11:44 +00:00
Vlad Zahorodnii
7029d9c57c Move XdgSurfaceClient::cleanGrouping() to WaylandClient 2020-09-03 18:11:44 +00:00
Vlad Zahorodnii
4296a38a30 Move geometry handling code from XdgSurfaceClient to WaylandClient 2020-09-03 18:11:44 +00:00
Vlad Zahorodnii
40dca1c93e Implement window hiding in the WaylandClient class
This change upstreams window hiding functionality from the XdgSurfaceClient
class to the WaylandClient class in order to reduce the amount of duplicated
code in new wayland client sub-classes.
2020-08-18 14:21:41 +00:00
Aleix Pol
2ed00e4afe Move XdgSurfaceClient::updateDepth to WaylandClient
It is strictly related to the surface and this way it can be used from
elsewhere.
2020-08-18 10:55:20 +00:00
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
31ea780d79 [wayland] Rework xdg-shell implementation
Summary:
This change splits the XdgShellClient class to better match existing
abstractions in the xdg-shell protocol and fix a few issues related to
sending configure events.

In the new client classes, configure events are handled differently.
Instead of blocking configure events, we try to send them as late as
possible. Delaying configure events will let us merge changeMaximize()
for X11 clients and Wayland clients and it also fixes the bug where
we don't send the final configure event when user has finished resizing
a window.

Given that configure events are not sent immediately, XdgSurfaceClient
keeps the last requested frame geometry and the last requested client
geometry.

This patch doesn't intend to fix all issues in kwin's implementation of
the xdg-shell protocol. For example, we still handle surface unmapping
very poorly.

Test Plan: Tests pass.

Reviewers: #kwin

Subscribers: kwin

Tags: #kwin

Differential Revision: https://phabricator.kde.org/D27861
2020-06-01 15:12:59 +03:00