Commit Graph

29 Commits (72ca9268cef8bd9fbe78fa6f2516d261748304f4)

Author SHA1 Message Date
Vlad Zahorodnii 72ca9268ce [wayland] Provide correct input geometry for client-side decorated clients
Summary:
Currently, the input geometry for client-side decorated clients matches
the frame geometry, which makes it impossible for a user to resize such
clients by just dragging invisible area near window borders.

BUG: 416346

Reviewers: #kwin, davidedmundson

Reviewed By: #kwin, davidedmundson

Subscribers: cblack, ngraham, kwin

Tags: #kwin

Differential Revision: https://phabricator.kde.org/D26716
2020-01-24 00:49:50 +02:00
Vlad Zahorodnii 55b4912004 Update my email address 2020-01-14 18:17:18 +02:00
David Edmundson 89024e2bcc Clamp XdgShellClient::clientSize to surface size, not m_windowGeometry
Summary:
It's perfectly legitimate to call setWindowSize before a buffer is
attached. This seems to have happen with plasma surfaces that commit
when attaching a shadow, but technically could happen anywhere.

By clamping to the applied surface here, we get the wrong window size
cached and not re-evaluated when a surface is eventually applied. This
leaves us thinking the windowsize is empty but with a massive margin
which actually holds the content.

We want all internal usages of xdgshellclient to use the window geometry
set. Only the wider kwin part needs to care about clamping it to the
surface.

This fixes popup placement in the plasma panel
BUG: 415317

As well as ghost notification popups with no background contrast that
you can't interact with.

Test Plan: Ran kwin

Reviewers: #kwin, zzag

Reviewed By: #kwin, zzag

Subscribers: romangg, kwin

Tags: #kwin

Differential Revision: https://phabricator.kde.org/D26233
2020-01-06 15:10:50 +00:00
Kai Uwe Broulik a823474ec3 Honour panelTakesFocus for other plasmashell types
The semantics of a window taking focus on user interaction apply to more roles. See D25851.

Given it is used by KWindowSystem::forceActivateWindow in kwayland-integration,
it makes sense to pass focus to the window once it gets this property set.

Differential Revision: https://phabricator.kde.org/D25968
2019-12-23 13:04:59 +01:00
Vlad Zahorodnii d394855536 Rename Toplevel::geom to Toplevel::m_frameGeometry
Summary: The new name better reflects what Toplevel::geom is.

Test Plan: Compiles, tests still pass.

Reviewers: #kwin, davidedmundson

Reviewed By: #kwin, davidedmundson

Subscribers: kwin

Tags: #kwin

Differential Revision: https://phabricator.kde.org/D25738
2019-12-04 15:47:15 +02:00
Vlad Zahorodnii e2f82d793b Use better name for geometryBeforeUpdateBlocking
Summary:
Rename geometryBeforeUpdateBlocking in order to better reflect that it
corresponds to the last frame geometry.

Test Plan: Compiles.

Reviewers: #kwin, romangg

Reviewed By: #kwin, romangg

Subscribers: kwin

Tags: #kwin

Differential Revision: https://phabricator.kde.org/D24658
2019-11-27 14:12:30 +02:00
Vlad Zahorodnii 85777aaac2 [wayland] Ensure that repaints_region is in frame-local coordinates
Summary:
The repaints region is in frame-local coordinates, i.e. relative to the
top-left corner of the frame geometry.

Reviewers: #kwin, romangg

Reviewed By: #kwin, romangg

Subscribers: davidedmundson, kwin

Tags: #kwin

Maniphest Tasks: T10867

Differential Revision: https://phabricator.kde.org/D24457
2019-11-27 14:12:30 +02:00
Vlad Zahorodnii 038509e603 [wayland] Provide correct input transformation matrix for client-side decorated clients
Summary: Pointer events must be in surface-local coordinates, not window geometry.

Reviewers: #kwin, davidedmundson

Reviewed By: #kwin, davidedmundson

Subscribers: kwin

Tags: #kwin

Maniphest Tasks: T10867

Differential Revision: https://phabricator.kde.org/D24456
2019-11-27 14:12:30 +02:00
Vlad Zahorodnii 9f7a856d23 [wayland] Implement window geometry more properly
Summary:
So far the window geometry from xdg-shell wasn't implemented as it should
be. A toplevel must have two geometries assigned to it - frame and buffer.
The frame geometry describes bounds of the client excluding server-side
and client-side drop-shadows. The buffer geometry specifies rectangle on
the screen occupied by the main surface.

State and geometry handling in XdgShellClient is still a bit broken. This
change doesn't intend to fix that, it must be done in another patch asap.

Test Plan: New tests pass.

Reviewers: #kwin, davidedmundson

Reviewed By: #kwin, davidedmundson

Subscribers: davidedmundson, romangg, kwin

Tags: #kwin

Maniphest Tasks: T10867

Differential Revision: https://phabricator.kde.org/D24455
2019-11-27 14:12:30 +02:00
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