Commit Graph

17972 Commits (61c6d5817204bb1e053a8d3676849e6031be8651)

Author SHA1 Message Date
Ismael Asensio 61c6d58172 [kwinrules] Add kconf_update script to fix placement rule
Since the port to KConfigXT, the placement setting in `kwinrulesrc` now stores the enum value instead of a string equivalent.
The strings and enum values are taken from `placement.h/.cpp`

This was suggested by @zzag in https://phabricator.kde.org/D29790
2020-05-27 18:13:00 +00:00
Johnny Jazeix 00b285623a fix compilation, remove extra parenthesis 2020-05-26 19:14:10 +02:00
Méven Car f0f465ccbd Wayland: avoid binding disabled outputs to surfaces
We don't need to bind disabled outputs to surfaces that overlaps them.
This prevents error down the line and warnings about ignoring surface.enter events with Qt.

BUG: 419749
2020-05-26 17:18:11 +02:00
David Edmundson e3044e619e Correctly align natural layout in present windows
Summary:
Present windows works as follows:

- It moves all windows about until nothing is overlapping with any
other window.
- This doesn't resize anything so ultimately we end up with a new
co-ordinate space that's bigger than the screen depending on the amount
of overlap.

 - We then render this whole view transformed to the screen

The rectangle "bounds" is in overviewpixels, with "scale" being the
ratio to convert to screen pixels.

When adjusting the new bounds there's an attempt to centre align things.
As bounds is in "overviewpixels" we multiply references to the previous
bounds by scale, and divide everything through at the end. bounds.x/y
were missed.

This is mostly unoticable except on massive super-ultra-wide monitors
which will otherwise have a tendency to shift to the left.

Test Plan:
Kai created a whole new test framework for this code that copy pasted
this algorithm then showed mock windows as rectangles

Reviewers: #kwin, apol, broulik, zzag

Reviewed By: #kwin, apol, broulik, zzag

Subscribers: zzag, apol, kwin

Tags: #kwin

Differential Revision: https://phabricator.kde.org/D29705
2020-05-26 10:52:16 +01:00
Ismael Asensio 91eee99fca [kcm/kwinrules] Extend upper limit of position and size spinners
Currently, the spinners used to edit position and size rules have an upper
limit of 4098, which may be not enough for wide/hdpi/mutiple screens.

The property itself has no such limit in the `.kcfg` schema
This is just an issue with the editor.

BUG: 421892
FIXED-IN: 5.19
2020-05-22 16:03:32 +02:00
Vlad Zahorodnii 621b2e1cde [decoration] Fix propagation of client size
Even though the frame geometry and the client geometry have a connection
between themselves, it doesn't mean that the frame geometry will change
if the client geometry has changed and vice versa. For example, it can be
the case when the border size changes. The frame geometry won't change,
but the client geometry will.

In general, similar to the frameGeometryChanged signal, we need another
signal that is emitted when the client geometry has been changed that
can be used then in DecoratedClientImpl.

Unfortunately, 5.19 release is around the corner and I would prefer not
to do any geometry-related changes in order to avoid introducing new
regressions.

In order to fix the propagation of the client size to decorations, this
change ports DecoratedClientImpl from frameGeometryChanged to a signal
that is emitted whenever geometry of any kind has been changed.

BUG: 419080
FIXED-IN: 5.19.0
2020-05-21 09:44:55 +00:00
Bhushan Shah b2df11bf7e [platforms/drm] show cursor only when it is enabled
In previous code we used to update/show cursor even when the pointer
device was present, e.g mobile device. Guard it behind the cursor
enabled check.

BUG: 418977
FIXED-IN: 5.19.0
2020-05-21 12:38:02 +05:30
Vlad Zahorodnii 7569bdf6a3 [scene] Re-build window quads after creating a WindowPixmap
In order to generate window quads for a window, the scene needs a valid
WindowPixmap tree. If it's time to render the window, the scene will
build window quads for the contents, the server-side window decoration,
the drop-shadow and cache the resulting window quads. With this way of
generating window quads, we need the window pixmap tree to be valid,
or else no contents window quads will be generated.

While the window pixmap tree is guaranteed to be valid at the time of
generation of window quads for Wayland and X11 clients, this is not the
case for Xwayland clients.

When an Xwayland client is created, some time may pass between the
moment it's been created and the moment when a regular wayland surface
has been associated with the xwayland window. If the compositor decides
to render the Xwayland client in that short period of time, the window
quads cache won't have window quads cache.

In order to work around the weird asynchronous behavior of Xwayland
clients, this change makes the scene discard the window quad cache when
a new window pixmap has been created. This will ensure that the current
window quads are always in sync with the current window pixmap tree.
2020-05-19 14:06:06 +03:00
Ismael Asensio bd5e34f5b4 [kcm/kwinrules] Detect virtual desktops in Wayland
The list of virtual desktops is retrieved using a DBus method, instead of
`KWindowSystem`, to make it work both in Wayland (as well as X11).

FIXED-IN: 5.20
BUG: 416165
2020-05-19 00:49:15 +02:00
Ismael Asensio fdd9ed53d9 [kcm/kwinrules] Fix Placement setting
Summary:
Since the port to KConfigXT, the setting "placement" is stored using the enum value, instead of a string equivalent.
This updates the kcm model to be able to communicate this property with the config schema.

BUG: 421586
FIXED-IN: 5.19.0

Test Plan:
- In a rule set the "Initial Placement" property
- The value is stored in `~/.config/kwinrulesrc`
- Close/reopen the kcm. The placement value is correctly loaded.

Reviewers: #kwin, #plasma, zzag

Reviewed By: #kwin, #plasma, zzag

Subscribers: zzag, kwin

Tags: #kwin

Differential Revision: https://phabricator.kde.org/D29790
2020-05-18 20:27:59 +02:00
Ismael Asensio db7fb26eed [kcm/kwinrules] Fix size properties not being stored
Summary:
Use `QSize`/`QPoint` to handle and store coordinate values (size and position)

Previously, the rules model stored the "coordinate" type properties as a
`QString` with format `x, y`.

This fails when setting the properties to the config schema, as it requires
a proper `QPoint` or `QSize` value, specially the latter which can't be
convert from such a string.

BUG: 421055
FIXED-IN: 5.19.0

Test Plan:
- Add a new rule and set its position and size properties
- Hitting apply stores the right values in `~\.config\kwinrulesrc`
- Close the kcm and reopen, the values are loaded
- Property detection still works for size and position

Please note that there is a pre-existing bug of some position/sizes not being
applied to the windows in some cases, when using `Apply Initially`.
Better try using the `Force` policy.

Reviewers: ngraham, #kwin, #plasma, zzag

Reviewed By: #kwin, #plasma, zzag

Subscribers: zzag, ltoscano, yurchor, kwin

Tags: #kwin

Differential Revision: https://phabricator.kde.org/D29764
2020-05-15 19:45:11 +02:00
Ismael Asensio 973957127d [kcm/kwinrules] Fix placeholder message in RulesEditor
Summary:
Fix the anchoring of the placeholder message after https://phabricator.kde.org/R108:9e5498238f88ece28f4f0d22da00879280cb7955
It needs to center on the free space, not the whole ListView.

Test Plan
Before: {F8323417}
After: {F8323416}

Reviewers: ngraham, broulik, #vdg, #plasma

Reviewed By: ngraham, #vdg

Subscribers: kwin

Tags: #kwin

Differential Revision: https://phabricator.kde.org/D29783
2020-05-15 19:44:43 +02:00
Jonathan Riddell d7687ce277 Update version number for 5.18.90
GIT_SILENT
2020-05-14 11:20:29 +01:00
Vlad Zahorodnii a68c0959a6 Revert "Improve partial maximization strings"
Summary:
This reverts commit 45bf53adab.

We cannot change config values for existing users since it will break
their installations.

Reviewers: #kwin, davidedmundson

Reviewed By: #kwin, davidedmundson

Subscribers: davidedmundson, bshah, broulik, kwin

Tags: #kwin

Differential Revision: https://phabricator.kde.org/D29736
2020-05-14 12:46:40 +03:00
Nate Graham 45bf53adab Improve partial maximization strings
Summary:
e.g. "Vertically maximize" is more natural and expressive than "Maximize (vertical only)"

See D29671#inline-169882.

Test Plan: New strings appear in the KCM

Reviewers: zzag, #vdg, #kwin, davidedmundson

Reviewed By: #kwin, davidedmundson

Subscribers: kwin

Tags: #kwin

Differential Revision: https://phabricator.kde.org/D29729
2020-05-13 12:31:02 -06:00
Méven Car c483e209fe Autotests: Add a test when relaunching a maximized cliend with BorderlessMaximizedWindows
Test Plan: Test pass

Reviewers: #kwin, zzag, davidedmundson

Reviewed By: #kwin, zzag

Subscribers: kwin

Tags: #kwin

Differential Revision: https://phabricator.kde.org/D29702
2020-05-13 16:41:33 +02:00
David Edmundson e8091a1d6f Follow scale of drag surfaces
Summary:
Similar to regular cursors a drag surface can have a scale.

The buffer "rect" should be in logical pixels at which point QPainter
will automatically handle everything.

CCBUG: 421395

Reviewers: #kwin, zzag, apol

Reviewed By: #kwin, zzag, apol

Subscribers: kwin

Tags: #kwin

Differential Revision: https://phabricator.kde.org/D29672
2020-05-13 14:44:27 +01:00
Vlad Zahorodnii 88c4de60fd [kcmkwin/kwinoptions] Use text to describe maximize button actions
Summary:
Currently, we use icons to display possible maximize button actions. The
problem with those icons is that they are confusing even for me, a person
who knows kwin in and out. The size_all icon implies that if you click the
maximize button, you'll be able to move the window around. Same goes with
the size_ver and size_hor icons, they indicate that user will start
resizing the window in the vertical and horizontal direction, respectively.

Test Plan:
Before

{F8312394}

After

{F8312395}

Reviewers: #kwin, #vdg, ndavis

Reviewed By: #vdg, ndavis

Subscribers: ngraham, ndavis, broulik, kwin

Tags: #kwin

Differential Revision: https://phabricator.kde.org/D29671
2020-05-13 09:23:36 +03:00
Nate Graham 9e5498238f [kcmkwin/kwinrules] Set saner width for Placeholder messages so they don't overflow
See D29692
2020-05-12 14:12:04 -06:00
Kai Uwe Broulik 65f611f700 [kcmkwin/kwinrules] Change translation domain
Make it consistently kcm_kwinrules to match the KAboutData

Differential Revision: https://phabricator.kde.org/D29674
2020-05-12 10:58:30 +02:00
Vlad Zahorodnii e19fa3d5c2 [kcmkwin/kwinoptions] Fix default for MaximizeButtonRightClickCommand
Summary:
KWin assumes that the default value for MaximizeButtonRightClickCommand
is Maximize (horizontal only).

Reviewers: #kwin, broulik

Reviewed By: broulik

Subscribers: kwin

Tags: #kwin

Differential Revision: https://phabricator.kde.org/D29673
2020-05-12 11:32:46 +03:00
Vlad Zahorodnii 7b751099bf Emit Workspace::clientAdded() with AbstractClient
Summary:
Currently, if one wants to monitor for new X11 and Wayland clients, they
have to listen for two signals. Workspace::clientAdded() is emitted only
for X11 and Xwayland clients, while WaylandServer::shellClientAdded() is
emitted only for xdg-shell clients. Such design doesn't scale well.

As the first towards emitting Workspace::clientAdded() for new Wayland
clients, this change replaces the X11Client parameter in the clientAdded
signal with AbstractClient.

Test Plan: Tests still pass.

Reviewers: #kwin, cblack

Reviewed By: cblack

Subscribers: kwin

Tags: #kwin

Differential Revision: https://phabricator.kde.org/D29665
2020-05-12 08:38:01 +03:00
Vlad Zahorodnii 079f9890ad [scripting] Introduce writable frameGeometry property
Summary:
The geometry property has been deprecated for quite some time and its
usage in scripts is highly discouraged. Since AbstractClient overrides
the geometry property to make it writable, the same thing must be done
for the frameGeometry property.

Reviewers: #kwin, davidedmundson

Reviewed By: #kwin, davidedmundson

Subscribers: kwin

Tags: #kwin

Differential Revision: https://phabricator.kde.org/D29666
2020-05-12 08:35:18 +03:00
l10n daemon script a35792e59d 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"
2020-05-12 06:33:43 +02:00
Tiago Corrêa 45c6e4b811 scripting: Introduce ClientModelByScreenAndActivity
Summary: Provide for KWin scripts the possibility to work with a activities aware ClientModel. In the same way that the ClientModelByScreenAndDesktop works with virtual desktops.

Reviewers: #kwin, mart, zzag

Reviewed By: #kwin, zzag

Subscribers: zzag, kwin

Tags: #kwin

Differential Revision: https://phabricator.kde.org/D29284
2020-05-11 14:27:00 +03:00
Vlad Zahorodnii d503307858 Merge branch 'Plasma/5.18' 2020-05-11 14:22:05 +03:00
Vlad Zahorodnii 6f8b8efb33 [wayland] Place lockscreen greeter above other windows
Summary: BUG: 420802

Reviewers: #kwin, davidedmundson

Reviewed By: #kwin, davidedmundson

Subscribers: apol, kwin

Tags: #kwin

Differential Revision: https://phabricator.kde.org/D29523
2020-05-11 14:21:21 +03:00
Vlad Zahorodnii 78180c0348 Merge setting up abstractclient and x11client connections in EffectsHandler
Summary: Toplevel::paddingChanged() is not an X11-specific signal.

Test Plan: Relevant tests still pass.

Reviewers: #kwin, apol

Reviewed By: apol

Subscribers: apol, kwin

Tags: #kwin

Differential Revision: https://phabricator.kde.org/D29520
2020-05-11 13:27:45 +03:00
Vlad Zahorodnii 44143ef7ae Move core shade code to AbstractClient
Summary:
In order to allow shading wayland clients, this change moves core shade
code from X11Client to AbstractClient.

Test Plan: Shading still works on X11.

Reviewers: #kwin, cblack

Reviewed By: cblack

Subscribers: cblack, kwin

Tags: #kwin

Differential Revision: https://phabricator.kde.org/D29512
2020-05-07 22:03:31 +03:00
Vlad Zahorodnii f29ca8a293 Remove unused method
Summary: mouseButtonToWindowOperation() is an artifact from the libkdecorations times.

Reviewers: #kwin, davidedmundson

Reviewed By: #kwin, davidedmundson

Subscribers: kwin

Tags: #kwin

Differential Revision: https://phabricator.kde.org/D29504
2020-05-07 14:37:30 +03:00
Vlad Zahorodnii 1dd3c7e8ba [effects/showfps] Calculate "correct" FPS
Summary:
cca0e15b45 broke code that calculates the value of the fps counter.

The frames field stores timestamps of previous frames, not time between
each two consecutive frames.

This change doesn't attempt to make the show fps compute more accurate
performance metrics, e.g. how much times it takes to execute rendering
commands on the GPU, etc.

Test Plan: The Show FPS effect displays more sensible values.

Reviewers: #kwin, davidedmundson

Reviewed By: #kwin, davidedmundson

Subscribers: davidedmundson, broulik, kwin

Tags: #kwin

Differential Revision: https://phabricator.kde.org/D29247
2020-05-07 09:17:02 +03:00
Tiago Corrêa e38a241048 scripting: Make workspace.currentActivity writable
Summary: Allows KWin scripts to change the value of workspace.currentActivity property.

Reviewers: #kwin

Subscribers: zzag, kwin

Tags: #kwin

Differential Revision: https://phabricator.kde.org/D29458
2020-05-07 08:36:02 +03:00
Ismael Asensio 471554b7a3 [kcm/kwinrules] Fix layout misalignment of list items
Summary:
Remove anchors within `Kirigami.AbstractListItem` delegates.
They were causing random misalignment of items in the main and the overlay `ListView`s

Test Plan:
Before {F8284332}
After {F8284333}

Reviewers: broulik, #vdg, #kwin, ngraham

Reviewed By: #vdg, ngraham

Subscribers: ahiemstra, ngraham, kwin

Tags: #kwin

Differential Revision: https://phabricator.kde.org/D29423
2020-05-06 20:22:25 +02:00
Kai Uwe Broulik 760765ed52 Merge branch 'Plasma/5.18' 2020-05-06 15:15:42 +02:00
Kai Uwe Broulik 5ea54eda5d [kcmkwin/kwindecoration] Don't exec() QDialog
Using nested event loops with QML is always troublesome.

BUG: 421053
FIXED-IN: 5.18.6

Differential Revision: https://phabricator.kde.org/D29473
2020-05-06 15:15:03 +02:00
Vlad Zahorodnii 325b85f8ca Drop Workspace::sendPingToWindow()
Summary:
This change drops Workspace::sendPingToWindow() in order to better
separate X11-specific and more generic code.

Test Plan: Still able to close X11 windows.

Reviewers: #kwin, apol

Reviewed By: apol

Subscribers: kwin

Tags: #kwin

Differential Revision: https://phabricator.kde.org/D29472
2020-05-06 15:05:51 +03:00
Jonathan Riddell 0e213a4a16 Update version number for 5.18.5
GIT_SILENT
2020-05-05 12:31:25 +01:00
Yuri Chornoivan d5e5e2f1c7 Fix message extraction 2020-05-04 18:09:13 +03:00
Vlad Zahorodnii 63014d2cb1 [scene] Re-order some connects in Scene::addToplevel()
Re-order some connects to keep them spatially close.

Differential Revision: https://phabricator.kde.org/D29131
2020-05-04 15:37:03 +03:00
Vlad Zahorodnii 774e43c51d Revert "Reload Shm texture when buffer size changes"
This reverts commit d6f98d1ecc.

The proposed solution is incorrect and we leak video memory.

Differential Revision: https://phabricator.kde.org/D29131
2020-05-04 15:36:55 +03:00
Vlad Zahorodnii 9bfcfb7f74 [scene] Rebuild window quads when sub-surface tree changes
Sub-surface contribute to the window quads cache. So, we must re-build
it, if any sub-surface has been changed.

Differential Revision: https://phabricator.kde.org/D29131
2020-05-04 15:36:40 +03:00
Vlad Zahorodnii f2c8981f7e [scene] Generate window quads for sub-surfaces
No window quads are generated for sub-surfaces right now. This leads to
issues with effects that operate on window quads, e.g. magic lamp and
wobbly windows. Furthermore, the OpenGL scene needs window quads to
properly clip windows during the rendering process.

The best way to render sub-surfaces would be with a little help from a
scene graph. Contrary to GNOME, KDE hasn't developed any scene graph
implementation that we could use in kwin. As a short term solution, this
change adjusts the scene to generate window quads.

Window quads are generated as we traverse the current window pixmap tree
in the depth-first search manner. In order to match a list of quads with
a particular WindowPixmap, we assign an id to each quad.

BUG: 387313
FIXED-IN: 5.19.0

Differential Revision: https://phabricator.kde.org/D29131
2020-05-04 15:36:30 +03:00
Vlad Zahorodnii 2d88fd0ee3 [scene] Release previous pixmap when a raster buffer is attached
We need to release the previous window pixmap if the new pixmap is
valid. However, it's currently the case only when the client has
attached either an fbo buffer or a wl_buffer. If an internal client
has attached a raster buffer, the previous window pixmap won't be
released.

In order to ensure that we're going to release the previous window
pixmaps no matter what type of buffer has been attached, this change
refactors WindowPixmap to use isValid() to verify that the new
window pixmap is valid.

Differential Revision: https://phabricator.kde.org/D29131
2020-05-04 15:36:23 +03:00
Vlad Zahorodnii e4b598ca86 [scene] Build window pixmap trees before starting rendering
In order to generate window quads for sub-surfaces, we need a valid
window pixmap tree. The problem is that the window pixmap tree is
created too late in the rendering process. This change adjusts the
scene so it creates window pixmap trees before buildQuads().

Differential Revision: https://phabricator.kde.org/D29131
2020-05-04 15:36:03 +03:00
Ismael Asensio 1a3cb256d7 [kcm/kwinrules] Improve export buttons
Summary:
Small UX improvements when exporting rules

Add a `Select All` button
Disable `Save` if no rules are selected
In export mode set button text to `Cancel Export`

Test Plan: {F8276279}

Reviewers: #kwin, #vdg, filipf

Reviewed By: #vdg, filipf

Subscribers: filipf, kwin

Tags: #kwin

Differential Revision: https://phabricator.kde.org/D29341
2020-05-02 19:43:02 +02:00
David Edmundson 3092043be5 [platforms/x11] Fix valigrind warning copying window icon for windowed mode
Summary:
windowIcon.pixmap().bits() creates and deletes the QPixmap object.

Which means data is dangling when we call m_winInfo->setIcon()

Surprisingly harmless in real life.

Test Plan: Reran kwin_wayland on X11 with valigrind

Reviewers: #kwin, apol

Reviewed By: apol

Subscribers: zzag, kwin

Tags: #kwin

Differential Revision: https://phabricator.kde.org/D28667
2020-05-01 16:13:40 +01:00
David Edmundson bc1991706c drop unused headers
Test Plan: N/A

Reviewers: apol

Reviewed By: apol

Subscribers: kwin

Tags: #kwin

Differential Revision: https://phabricator.kde.org/D29337
2020-05-01 16:13:33 +01:00
Laurent Montel 86cbf73386 Fix compile with strict iterator 2020-05-01 13:02:39 +02:00
Laurent Montel b54c57505d Fix warning about using 0 as nullptr 2020-05-01 13:02:20 +02: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