Commit graph

20 commits

Author SHA1 Message Date
Marco Martin
10ace126be [wayland] Make sure fullscreen windows aren't repositioned
Summary:
on X11, setFullScreen is always called after Placement::place()
so they always have the correct geometry.
on wayland, the window if is shown directly as fullscren,
is set fullscreen in init() then place() is evecuted, potentially
moving it to a wrong position and potentially even size (which happens
with maximiziong placement strategy)
so instead of place() the client needs to be explicitly set at
fullscreen geometry

Test Plan:
fullscreen windows always appear with the proper geometry
autotests still pass

Reviewers: #kwin, #plasma, davidedmundson

Reviewed By: #kwin, #plasma, davidedmundson

Subscribers: zzag, kwin

Tags: #kwin

Differential Revision: https://phabricator.kde.org/D24542
2019-10-11 10:46:43 +02:00
Marco Martin
1a9a49ab7a don't allow to resize or move fullscreen windows
Summary:
add the same check of the Client class: if a window
is fullscreen, is not movable nor resizable

Test Plan:
Doesn't have any visible regression over normal usage,
this partially tackles a bug that can be seen in plasma mobile:
if the placement is "maximizing", then asking windows to be
shown as fullscreen has no effect and they will always be shown as a normal
maximized window.

this now doesn't happen anymore.. most of the times,
 as there must be some race condition
as a concause of the problem

Reviewers: #plasma, davidedmundson

Reviewed By: #plasma, davidedmundson

Subscribers: kwin

Tags: #kwin

Differential Revision: https://phabricator.kde.org/D24515
2019-10-09 14:30:42 +02:00
Vlad Zahorodnii
7d4471eba6 Rename geometry property to frameGeometry
Summary:
In order to properly implement xdg_surface.set_window_geometry we need
two kinds of geometry - frame and buffer. The frame geometry specifies
visible bounds of the client on the screen, excluding client-side drop
shadows. The buffer geometry specifies rectangle on the screen that the
attached buffer or x11 pixmap occupies on the screen.

This change renames the geometry property to frameGeometry in order to
reflect the new meaning assigned to it as well to make it easier to
differentiate between frame geometry and buffer geometry in the future.

Reviewers: #kwin

Subscribers: kwin

Tags: #kwin

Differential Revision: https://phabricator.kde.org/D24334
2019-10-02 11:46:37 +03:00
Vlad Zahorodnii
45784b70e7 [wayland] Get rid of some code duplication in XdgShellClient constructors
Reviewers: #kwin, davidedmundson

Reviewed By: #kwin, davidedmundson

Subscribers: kwin

Tags: #kwin

Differential Revision: https://phabricator.kde.org/D24332
2019-10-02 11:29:08 +03:00
Vlad Zahorodnii
3ff0f3781a [wayland] Fix some coding style issues in setGeometry method
Reviewers: #kwin

Subscribers: kwin

Tags: #kwin

Differential Revision: https://phabricator.kde.org/D24331
2019-10-02 11:28:53 +03:00
Vlad Zahorodnii
07ded57273 [wayland] Add missing const qualifier in resizeWithChecks
Reviewers: #kwin, davidedmundson

Reviewed By: #kwin, davidedmundson

Subscribers: kwin

Tags: #kwin

Differential Revision: https://phabricator.kde.org/D24330
2019-10-02 11:28:36 +03:00
Vlad Zahorodnii
7c3d014f21 [wayland] Use setGeometry in resizeWithChecks
Summary:
Configure xdg-toplevel only through setGeometry method, so it's easier
to reason about how geometry is handled in XdgShellClient.

Reviewers: #kwin

Subscribers: kwin

Tags: #kwin

Differential Revision: https://phabricator.kde.org/D24329
2019-10-02 11:28:17 +03:00
Vlad Zahorodnii
84de8d135d [wayland] Process pending state and map the client on commit
Summary:
Move unrelated code out of XdgShellClient::addDamage() into a separate
method.

Reviewers: #kwin

Subscribers: kwin

Tags: #kwin

Differential Revision: https://phabricator.kde.org/D24328
2019-10-02 11:27:57 +03:00
Vlad Zahorodnii
39dca35d44 Delete unused include 2019-10-01 11:54:41 +03:00
Vlad Zahorodnii
4552096c1d Sort headers alphabetically in xdgshellclient.cpp 2019-09-30 18:18:44 +03:00
Vlad Zahorodnii
f93875535c Update my last name 2019-09-29 17:03:25 +03:00
Vlad Zahorodnii
99d3185949 Rename getShadow method to updateShadow
Summary: getShadow is not a getter method as it doesn't return a shadow.

Test Plan: Compiles.

Reviewers: #kwin, romangg

Reviewed By: #kwin, romangg

Subscribers: kwin

Tags: #kwin

Differential Revision: https://phabricator.kde.org/D24298
2019-09-29 15:26:53 +03:00
Vlad Zahorodnii
0cacd9dc0a [wayland] Fix some coding style issues in XdgShellClient
Summary:
The Frameworks coding style prohibits using short variable names, unless
it's a counter in a loop.

Reviewers: #kwin, davidedmundson

Reviewed By: #kwin, davidedmundson

Subscribers: davidedmundson, kwin

Tags: #kwin

Differential Revision: https://phabricator.kde.org/D24198
2019-09-26 12:22:14 +03:00
Vlad Zahorodnii
3047a68905 [wayland] Make XdgShellClient::init() more comprehensible
Summary:
Currently the init method is just a big pile of connects to lambdas,
which makes the code very difficult to read and moreover to change.
This change moves most of those lambda to handleFoo methods so one has
more clear view of what the init method is actually doing.

Reviewers: #kwin

Subscribers: kwin

Tags: #kwin

Differential Revision: https://phabricator.kde.org/D24197
2019-09-26 12:22:14 +03:00
Vlad Zahorodnii
7bc83a8653 [wayland] Drop initSurface method in XdgShellClient
Summary:
XdgShellClient can represent either a xdg-toplevel or xdg-popup. Therefore,
template initSurface method is no longer needed.

Reviewers: #kwin, davidedmundson

Reviewed By: #kwin, davidedmundson

Subscribers: kwin

Tags: #kwin

Differential Revision: https://phabricator.kde.org/D24196
2019-09-26 12:22:14 +03:00
Vlad Zahorodnii
c3772f4c81 Delete pointless nullptr checks
Lifetime of XdgShellClient is bounded to Workspace, so we no longer need
to check whether tabbox is still present around.
2019-09-24 18:10:59 +03:00
Vlad Zahorodnii
64feafc10f Mark Toplevel as not ready for painting by default
Summary:
Get rid of some duplication as InternalClient, XdgShellClient, Unmanaged,
and Client initialize ready_for_painting to false.

Reviewers: #kwin, davidedmundson

Reviewed By: #kwin, davidedmundson

Subscribers: davidedmundson, kwin

Tags: #kwin

Differential Revision: https://phabricator.kde.org/D24189
2019-09-24 17:05:43 +03:00
Vlad Zahorodnii
f67db3a918 Cleanup XdgShellClient header
Don't put method definitions in the header file of XdgShellClient class
as it makes the code visually inconsistent. InternalClient is a good
example of how the header file of a subclass of AbstractClient class
should look like.

This change also cleans up the order of things in the header file, thus
making it a bit more obvious where new things should go.
2019-09-24 10:45:45 +03:00
Vlad Zahorodnii
1571fb5b71 Delete unused include 2019-09-24 10:25:10 +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
Renamed from shell_client.cpp (Browse further)