Commit graph

18241 commits

Author SHA1 Message Date
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
Méven Car
137a6a1705 ScreenShotEffect: Add a shouldReturnNativeSize argument to screenshotFullscreen
Summary:
Add a shouldReturnNativeSize to screenshotFullscreen so that KWin can export
screenshot that are screen pixel accurate.

Useful for spectacle to be able to do rectangular selection kind of screenshot.

Test Plan:
Example of a top screen using a 1.25 scale ratio being export in native resolution
{F8255144}
(The top screen has a bigger size than its virtual geometry and next screen doesn't overlap)

Example of the same screen in virtual resolution:
{F8255146}

Reviewers: #kwin, davidedmundson, bport, zzag, apol

Reviewed By: #kwin, davidedmundson

Subscribers: broulik, kwin

Tags: #kwin

Differential Revision: https://phabricator.kde.org/D29122
2020-04-29 19:16:22 +02:00
Vlad Zahorodnii
a6d29add93 Fix build on FreeBSD 2020-04-29 16:54:06 +03:00
Vlad Zahorodnii
76af96bcc9 [x11] Disable synchronized resizing for Xwayland < 1.21
In case Xwayland does not use multiple buffers, the currently attached
buffer is going to be destroyed if the frame window is resized. It may
render the previous and the current window pixmap invalid and thus result
in visual artifacts when an X11 client is being interactively resized.

In order to avoid the visual artifacts, this change disables support for
synchronized resizing for X11 clients if the version of Xwayland is less
than the version in which Xwayland started using multiple buffers, i.e.
1.21.

Differential Revision: https://phabricator.kde.org/D29250
2020-04-29 16:37:31 +03:00
Vlad Zahorodnii
a9d2bad007 [x11] Enable synchronized resizing for Xwayland clients
Given that we now query the current X11 time stamp on Wayland, we can
enable synchronized resizing for Xwayland clients.

Differential Revision: https://phabricator.kde.org/D29250
2020-04-29 16:37:23 +03:00
Vlad Zahorodnii
0323825f76 [x11] Update X11 time stamp on Wayland
Assume that Xwayland's current X11 time stamp corresponds to the system
monotonic time. Unfortunately, we cannot make roundtrips to Xwayland and
we cannot query the time stamp asynchronously because it may introduce
regressions in the standalone X11 window manager.

Differential Revision: https://phabricator.kde.org/D29250
2020-04-29 16:37:02 +03:00
l10n daemon script
f579dc339c 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-04-29 10:52:05 +02:00
Yuri Chornoivan
385c8d3db6 Make the string translatable
Summary:
Currently this string is marked as untranslatable for the unknown reason

Patch by Victor Ryzhykh

Test Plan: Translate, run.

Reviewers: #kwin, zzag

Reviewed By: #kwin, zzag

Subscribers: kwin

Tags: #kwin

Differential Revision: https://phabricator.kde.org/D29271
2020-04-29 09:34:53 +03:00
l10n daemon script
34de0b746e 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-04-29 06:38:00 +02:00
Vlad Zahorodnii
2fa5526f12 [wayland] Pass command line arguments to launched processes
Summary:
Since QProcess::setProgram() doesn't split the command, we need to do it
ourselves.

Test Plan: `dbus-run-session kwin_wayland "kate foo.txt"` works again.

Reviewers: #kwin, cblack, davidedmundson, apol

Reviewed By: #kwin, cblack, davidedmundson, apol

Subscribers: apol, kwin

Tags: #kwin

Differential Revision: https://phabricator.kde.org/D29253
2020-04-28 20:58:53 +03:00
Vlad Zahorodnii
d3303bc407 Merge branch 'Plasma/5.18' 2020-04-28 20:55:00 +03:00
Vlad Zahorodnii
f823be570c Make Compositor more verbose
Summary:
In order to help with debugging why the OpenGL scene is not loaded,
it can be really helpful to know what scenes the Compositor attempts to
load.

Test Plan: Ran kwin with QT_LOGGING_RULES="*.debug=true".

Reviewers: #kwin, davidedmundson

Reviewed By: #kwin, davidedmundson

Subscribers: kwin

Tags: #kwin

Differential Revision: https://phabricator.kde.org/D29261
2020-04-28 20:54:46 +03:00
Benjamin Port
750dd068e5 [Wayland] Send stacking order event through plasma window management protocol
Summary: Depends on: D29054

Reviewers: zzag, davidedmundson, meven

Reviewed By: davidedmundson, meven

Subscribers: kwin

Tags: #kwin

Differential Revision: https://phabricator.kde.org/D29055
2020-04-27 09:31:29 +02:00
l10n daemon script
028aecaaf9 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-04-27 06:06:37 +02:00
Andreas Sturmlechner
1e70f08093 kwinscreenedges: Fix build (missing main.ui in kcm_kwintouchscreenedges_PART_SRCS)
Summary: kwinscreenedgeconfigform.cpp:23:10: fatal error: ui_main.h: No such file or directory

Test Plan: kwin builds again.

Reviewers: #kwin, davidedmundson

Reviewed By: #kwin, davidedmundson

Subscribers: kwin

Tags: #kwin

Differential Revision: https://phabricator.kde.org/D29212
2020-04-26 20:16:54 +02:00
Nate Graham
f9faa94ccc [kcmkwin/kwinrules] Port placeholder message to Kirigami.PlaceholderMessage
Summary: Depends on D29152

Test Plan:
{F8256396}

{F8257685}

Reviewers: iasensio, #kwin, zzag

Reviewed By: iasensio, #kwin, zzag

Subscribers: kwin

Tags: #kwin

Maniphest Tasks: T13021

Differential Revision: https://phabricator.kde.org/D29141
2020-04-24 08:30:07 -06:00
Ismael Asensio
a158d3cbd3 Rules kcm: Use new property ComboBox.currentValue
Summary:
Use the properties `valueRole` and `currentValue`, introduced in Qt5.14 for `QQC2.ComboBox`

This didn't work before due to QQC2 version being mis-detected at build time, so the code mocked an internal `currentValue` property.

After D28859, it is now required to fix:
   "file:///home/nate/kde/usr/share/kpackage/kcms/kcm_kwinrules/contents/ui/RulesEditor.qml"
   "Error loading QML file.\n42: Type RuleItemDelegate unavailable\n68: Type OptionsComboBox unavailable\n35: Cannot override FINAL property\n"
   QCoreApplication::postEvent: Unexpected null receiver

Test Plan:
Try to edit a rule or add a new one.
The rule editor page shows.

Reviewers: ngraham, #kwin, zzag

Reviewed By: ngraham, #kwin, zzag

Subscribers: kwin

Tags: #kwin

Differential Revision: https://phabricator.kde.org/D29145
2020-04-24 15:09:51 +02:00
Vlad Zahorodnii
890c770033 Merge branch 'Plasma/5.18' 2020-04-24 13:28:57 +03:00
Vlad Zahorodnii
fd106de650 [scripting] Re-evaluate exclusions after switching between virtual desktops or activities
Summary:
OtherDesktopsExclusion and OtherActivitiesExclusion flags must be
re-evaluated after user has switched between virtual desktops or
activities; otherwise ClientLevel may contain clients that are not
necessarily on the current virtual desktop or activity.

Reviewers: #kwin, davidedmundson

Reviewed By: #kwin, davidedmundson

Subscribers: kwin

Tags: #kwin

Maniphest Tasks: T12877

Differential Revision: https://phabricator.kde.org/D28827
2020-04-24 13:28:39 +03:00
Vlad Zahorodnii
5b947c6458 Revert "Allow building with Qt 5.12"
This reverts commit 54c6acadf2.

Differential Revision: https://phabricator.kde.org/D29147
2020-04-24 10:19:23 +03:00
Vlad Zahorodnii
a848490cae Revert "More for Qt 5.12"
This reverts commit 3e9f33bb3e.

Differential Revision: https://phabricator.kde.org/D29147
2020-04-24 10:19:17 +03:00
Vlad Zahorodnii
fdb14928f6 Revert "Qt 5.12, qhash"
This reverts commit 59ad852c02.

Differential Revision: https://phabricator.kde.org/D29147
2020-04-24 10:19:09 +03:00
Vlad Zahorodnii
c61b85f502 Revert "Fix build with Qt 5.12, Qt::hex and Qt::endl"
This reverts commit d18449c743.

Differential Revision: https://phabricator.kde.org/D29147
2020-04-24 10:18:45 +03:00
Cyril Rossi
db9d7a7f5d KCM KWinScreenEdge fix build issue
Summary: Remove Q_ASSERT() and add a None value to Monitor::Edge enum to convert ElectricBorder NONE or COUNT

Test Plan: Fix kwin build

Reviewers: #kwin, ngraham, zzag

Reviewed By: #kwin, ngraham, zzag

Subscribers: kwin

Tags: #kwin

Differential Revision: https://phabricator.kde.org/D29104
2020-04-23 08:48:25 +02:00
l10n daemon script
8c7956b923 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-04-23 06:36:52 +02:00
Ismael Asensio
a04b40dadb KWinRules KCM Redesign
Summary:
Replacement KCM to configure kwin rules, using a QML-based UI.

After some work on the task T12729, it is almost feature-par with the previous module, and adapted to the recent move to KConfigXT.

Test Plan:
{F8208046}
{F8208047}

Reviewers: #plasma, #kwin, #vdg, ngraham, davidedmundson, zzag

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

Subscribers: ngraham, davidedmundson, hchain, broulik, zzag, kwin

Tags: #kwin, #vdg

Differential Revision: https://phabricator.kde.org/D28152
2020-04-22 21:34:48 +02:00
Aleix Pol
19bfa7c065 egl: encapsulate and share duplicated code
Summary:
Removes a few TODO items mentioning that some code was exactly the same
in a couple of different places.

drm: Remove unnecessary cast

Test Plan:
Using it right now
Will push in 2 different commits

Reviewers: #kwin, zzag

Reviewed By: #kwin, zzag

Subscribers: zzag, kwin

Tags: #kwin

Differential Revision: https://phabricator.kde.org/D28708
2020-04-22 16:31:40 +02:00
Cyril Rossi
cf7762eaa8 KCM KWinScreenEdges disable widgets if is immutable
Summary:
Same as D28507

Disable screen edge modification, but allow the user to open an edge context menu and see the settings.

To set an edge immutable, just add `[$i]` right after the entry in `ElectricBorders` group, although the edges settings are shared between some `[Effect-something]` group under the key `BorderActivateSomething`.

Since one entry like `BorderActivateSomething` lists all edges that use this effect, it doesn't make sense to set it immutable.

Test Plan:
In `kwinrc`, set the `ElectricBorders` and/or `Windows` group immutable or any entry.

```
[ElectricBorders]
BottomLeft[$i]=None
Left=None
Right=None
Top[$i]=None

[Windows][$i]
ElectricBorderCornerRatio=0.29
ElectricBorderDelay=300
ElectricBorderMaximize=false
ElectricBorderTiling=true
ElectricBorders=2
```

Reviewers: ervin, bport, meven, zzag, #kwin, mart

Reviewed By: ervin, zzag, #kwin, mart

Subscribers: kwin

Tags: #kwin

Differential Revision: https://phabricator.kde.org/D28508
2020-04-22 11:10:17 +02:00
Cyril Rossi
a9c0337113 KCM KWinTouchEdges disable edge if is immutable
Summary:
Disable touch screen edge modification, but allow the user to open an edge context menu and see the settings.

To set an edge immutable, just add `[$i]` right after the entry in `TouchEdges` group, although the edges settings are shared between some `[Effect-something]` group under the key `TouchBorderActivateSomething`.

Since one entry like `TouchBorderActivateSomething` lists all edges that use this effect, it doesn't make sense to set it immutable.

Test Plan:
In `kwinrc`, set the `TouchEdges` group immutable or any entry.

```
[TouchEdges]
Bottom=None
Left=None
Right=None
Top[$i]=None
```

Reviewers: ervin, bport, meven, zzag, #kwin, mart

Reviewed By: ervin, zzag, #kwin, mart

Subscribers: kwin

Tags: #kwin

Differential Revision: https://phabricator.kde.org/D28507
2020-04-22 11:10:12 +02:00
Cyril Rossi
128eb13c09 KCM KWinScreenEdges port to KConfigXT
Summary: Following D27862 port KWinScreenEdges to KConfigXT, handle isSaveNeeded and isDefault KCModule state.

Reviewers: #kwin, ervin, bport, meven, zzag

Reviewed By: #kwin, ervin, zzag

Subscribers: kwin

Tags: #kwin

Differential Revision: https://phabricator.kde.org/D28475
2020-04-22 11:10:02 +02:00
Cyril Rossi
01314f8e9a KCM KWinTouchScreen port to KConfigXT
Summary:
Also manage KCModule states (isSaveNeeded and isDefaults)

BUG: 405573

Test Plan:
* exec kcmshell5 kwintouchscreen
* In an edge, select action Present windows - All desktops, then apply
* close and reopen
* Should display action Present windows - All desktops in the previously selected edge.

* Do same test with Present windows - current desktop

Reviewers: #kwin, ervin, bport, meven, zzag

Reviewed By: #kwin, ervin, meven, zzag

Subscribers: kwin

Tags: #kwin

Differential Revision: https://phabricator.kde.org/D27862
2020-04-22 11:09:39 +02:00
l10n daemon script
4e7394457c 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-04-22 11:03:45 +02:00