Commit graph

17590 commits

Author SHA1 Message Date
Roman Gilg
af3fbf343b Remove buffer flip pending assert for now
The assert is still not always true.

BUG: 415750
2019-12-31 20:34:02 +01:00
Laurent Montel
d3cbacd451 convert endl to \n (in qt5.15 it's Qt:: namespaced) 2019-12-31 07:44:21 +01:00
Roman Gilg
514a95f1e4 Set Qt::KeypadModifier depending on current keysym
Summary:
The Qt::KeypadModifier should only accompany a keysym when this specific keysym
originates from the keypad not in general for every keysym while numlock is
engaged.

BUG: 400658
FIXED-IN: 5.18.0

Test Plan: Manually with the Thumbnail Grid task switcher and numlock enabled.

Reviewers: #kwin, davidedmundson

Reviewed By: #kwin, davidedmundson

Subscribers: kwin

Tags: #kwin

Differential Revision: https://phabricator.kde.org/D26283
2019-12-30 14:41:26 +01:00
Roman Gilg
1e3128b0db Flexible composite swap and timer events
Summary:
The GLX backend might need a combination of swap and composite timer events for
continous painting.

The reason for that is that if the buffer age extension is not available we
fall back to copies in case not the whole screen is repainted.

The timer logic is adapted to make this possible in a lean way what cleans up
the Compositor class in several ways.

Test Plan: Tested on X11 (with/without swap events, buffer age enabled)  and Wayland.

Reviewers: #kwin

Subscribers: hurikhan77, kwin

Tags: #kwin

Differential Revision: https://phabricator.kde.org/D26216
2019-12-30 14:29:46 +01:00
Méven Car
2bb4acf760 KCM/Effects: convert a couple C-style cast
Summary: Followup after D26040

Reviewers: ervin, zzag, davidedmundson

Reviewed By: davidedmundson

Subscribers: kwin

Tags: #kwin

Differential Revision: https://phabricator.kde.org/D26286
2019-12-30 11:32:30 +01:00
Laurent Montel
9b41e93540 Don't use nullptr as default flags 2019-12-30 06:54:08 +01:00
Yuri Chornoivan
054cfc1c8a Fix trivial Doxygen warning 2019-12-25 11:37:17 +02:00
Roman Gilg
be01ba0ae7 Fix buffer swap assert
After paint in case we have swap events the buffer swap should be pending.

This is not always the case with the X11 standalone plugin what needs to be
investigated some more. This is for now a quick fix to make sessions work
again without failing on the assert.
2019-12-24 17:43:30 +01:00
l10n daemon script
b78a104f50 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"
2019-12-24 05:45:06 +01:00
Roman Gilg
ba2c0324d2 Reset buffer swap state on stop
Summary:
When the compositor is stopped there might still be a buffer swap ongoing, in
particular when a client blocks compositing on X11.

Depending on the backend the next buffer swap event might be handled in
bufferSwapComplete (Wayland) or not be handled (X11 GLX, since a new
GLX window will be created while the swap event is sent for the old one).

With this patch the buffer swap state is reset on stop such that on later
start no outdated data might create errors  and instead a new repaint can be
triggered with updated data.

BUG: 415262

Test Plan: Manually on X11 and Wayland.

Reviewers: #kwin, davidedmundson

Reviewed By: #kwin, davidedmundson

Subscribers: kwin

Tags: #kwin

Differential Revision: https://phabricator.kde.org/D26090
2019-12-23 23:55:51 +01:00
Laurent Montel
45177bb29b Remove deprecated method
Summary: Remove some deprecated method

Reviewers: zzag

Reviewed By: zzag

Subscribers: davidedmundson, zzag, kwin

Tags: #kwin

Differential Revision: https://phabricator.kde.org/D25735
2019-12-23 14:09:02 +01:00
Méven Car
790e717c82 [KCM/Desktop] Port from KQuickAddons::ConfigModule to ManagedConfigModule
Test Plan:
kcmshell5 kcm_kwin_virtualdesktops
kcm works as before

Reviewers: #kwin, ervin, crossi, zzag

Reviewed By: #kwin, ervin, zzag

Subscribers: zzag, bport, crossi, kwin

Tags: #kwin

Differential Revision: https://phabricator.kde.org/D25881
2019-12-23 13:22:36 +01: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
l10n daemon script
c29c165032 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"
2019-12-22 05:40:21 +01:00
Méven Car
cc4d191a94 [KCM/Effects] Allow the user to know when the settings are set to default
Summary: It works for the effect

Test Plan:
kcmshell5 kcm_kwin_effects
Change some settings, the "Restore defaults" button is enabled when the state is not the default state.
Open an effect configuration, the "Restore defaults" button is enabled when the settings are not default.

Reviewers: #kwin, crossi, ervin, zzag

Reviewed By: #kwin, zzag

Subscribers: zzag, kwin

Tags: #kwin

Differential Revision: https://phabricator.kde.org/D26040
2019-12-20 17:53:41 +01:00
Roman Gilg
d72e96802b Revert "Add default shortcut to switch to the desktop to the left/right/top/bottom"
I nack this change. This needs to be discussed more and a different solution
needs to be found. See constraints defined in:
https://phabricator.kde.org/D24281#578243

This reverts commit 20ca3bb57a.
2019-12-15 15:25:31 +01:00
Björn Feber
20ca3bb57a Add default shortcut to switch to the desktop to the left/right/top/bottom
Summary: Same as on Windows 10, very useful when you use virtual desktops.

Test Plan: Have 2 or more virtual desktops and use the new shortcut.

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

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

Subscribers: davidedmundson, thiagosueto, ngraham, romangg, zzag, #vdg, #plasma, kwin, #kwin

Tags: #kwin

Maniphest Tasks: T11520

Differential Revision: https://phabricator.kde.org/D24281
2019-12-15 13:36:27 +01:00
David Edmundson
ad285840dc Merge branch 'Plasma/5.17' 2019-12-14 16:09:32 +01:00
David Edmundson
1a13015d2d Possible fix for KDecoration crash in systemsettings
Summary:
I could never reproduce the crash, but we know from gdb that it's from
the decorationSettings object

We are setting the same QObject instance as a context property in
multiple contexts at once. This is already slightly odd especially from the POV of
Qt's internal property cache.

Given we want one object to be exposed to all contexts, we can expose it
to the parent context only once and achieve the same result in a simpler
way.

BUG: 411166

Test Plan:
Verified opening and closing system settings still worked for me.
I could never reproduce the original crash.

Reviewers: #kwin, ngraham

Reviewed By: ngraham

Subscribers: ngraham, apol, kwin

Tags: #kwin

Differential Revision: https://phabricator.kde.org/D25913
2019-12-14 16:08:16 +01:00
Marco Martin
d593f24d69 fix thumbnails positioning
to have the scene position of the thumbnail, you need
item->mapToScene(QPointF(0,0)); and not add to that its parent-relative position
2019-12-13 18:14:08 +01:00
Aleix Pol
3efedf510c Improve debug information on key events
Summary: Print the Qt::Key value on the debug window

Test Plan: When I press the power button I get Key_PowerOff

Reviewers: #kwin, romangg

Reviewed By: #kwin, romangg

Subscribers: romangg, kwin

Tags: #kwin

Differential Revision: https://phabricator.kde.org/D25896
2019-12-13 15:43:44 +01:00
Vlad Zahorodnii
31e664783f Revert "[effects/fallapart] Override scale, fade, and glide effect"
This reverts commit 1747e497e4.

Unfortunately, this patch causes fall apart effect to override sliding
popups effect, which we really don't want to do.
2019-12-12 15:31:56 +02:00
Vlad Zahorodnii
8ab727766a [scenes/xrender] Correctly render client-side decorated clients
Summary:
The buffer shape is in buffer-local coordinates and must be mapped to
window coordinates. After that, we are free to map it to the global screen
coordinates.

Reviewers: #kwin, davidedmundson

Reviewed By: #kwin, davidedmundson

Subscribers: kwin

Tags: #kwin

Differential Revision: https://phabricator.kde.org/D25733
2019-12-12 14:39:25 +02:00
Vlad Zahorodnii
a7e18789cb Fix crash in XRenderPictureData::~XRenderPictureData
Summary:
If the XRender scene has cross-faded a window, then, eventually, KWin/X11 will
crash in the destructor of the XRenderPictureData class during tear down with
the following message in the terminal

```
ASSERT: "qApp" in file /home/vlad/Workspace/KDE/src/kde/workspace/kwin/libkwineffects/kwinxrenderutils.cpp, line 163
```

The crash happens because X11StandalonePlatform attempts to clean up XRender
resources, including XRenderUtils::s_blendPicture, after the application object
has been destroyed.

In order to fix the crash, we have to destroy the platform object before the
destructor of QCoreApplication is executed.

Test Plan:
- Enable maximize effect
- Maximize a window
- Replace the current instance of KWin/X11 with another one

Without this patch, KWin/X11 crashes after the third step.

Reviewers: #kwin, davidedmundson

Reviewed By: #kwin, davidedmundson

Subscribers: kwin

Tags: #kwin

Differential Revision: https://phabricator.kde.org/D25768
2019-12-12 14:06:27 +02:00
l10n daemon script
2c8ff56540 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"
2019-12-12 05:47:19 +01:00
Roman Gilg
e7da4d65ec [platforms/x11/standalone] Use intel swap events by default
Summary:
Activate intel swap events by default if available. They were hidden behind an
environmental variable because of some critical release blocking issue years
ago.

Manual testing indicates that there are no issues anymore with this extension.
Since it allows us to use swap events with MESA drivers for optimized repaints
enable swap events by default again.

For now leave a modified environment variable to switch back to using no swap
events easily.

CCBUG: 342582

Test Plan: i915

Reviewers: #kwin

Subscribers: zzag, broulik, kwin

Tags: #kwin

Maniphest Tasks: T11071

Differential Revision: https://phabricator.kde.org/D25300
2019-12-12 01:57:21 +01:00
Roman Gilg
00bf75d06e Composite without timer on swap events
Summary:
When swap events are available do not delay the next repaint by one frame
through the composite timer but directly repaint on swap event.

Test Plan: i915

Reviewers: #kwin

Subscribers: davidedmundson, zzag

Maniphest Tasks: T11071

Differential Revision: https://phabricator.kde.org/D25299
2019-12-12 01:47:54 +01:00
Roman Gilg
a55dee3bd3 Add hasSwapEvent getter
Summary:
Add a small getter to query information internally if the backend supports
swap events. Defaults to true as it is the default in the GBM Wayland backend.

Test Plan: i915

Reviewers: #kwin

Subscribers: kwin

Tags: #kwin

Maniphest Tasks: T11071

Differential Revision: https://phabricator.kde.org/D25298
2019-12-12 01:25:36 +01:00
Roman Gilg
7eafab7304 [platforms/drm] Return when property found
When initializing a property we loop through the drmModeObjectProperties
object and search for the property by its name.

Once found we create the Property object and there should be not another one
with the same name afterwards. In any case we would leak memory. Therefore just
directly return once the property was found.

This gives us the added benefit that we can put out a warning in case the
property was not found in the loop, what should not happen with the properties
we use.
2019-12-11 18:38:21 +01:00
Roman Gilg
daa1cf9402 [platforms/drm] Align plane type enum with kernel
This is just a code cosmetic change to have the same values internally like the
kernel for the type enum. In the logic there should not be a difference since
the enum values are mapped at runtime.
2019-12-11 18:19:41 +01:00
Roman Gilg
cec4e57b52 [platforms/drm] Do plane and object chore
Summary:
This cleans up some of the code, moves and deletes superfluous functions,
improves in-code docs and runtime warnings.

Test Plan: On vt.

Reviewers: #kwin

Subscribers: kwin

Tags: #kwin

Differential Revision: https://phabricator.kde.org/D25867
2019-12-11 18:05:35 +01:00
Roman Gilg
33bcc43fdf [scenes/opengl] Remove glDrawBuffer call
Summary:
According to Gl 3.2 (page 501) and 4.5 (page 204) specs the initial state of
the default framebuffer is already BACK. Therefore we do not need to set it
explicitly.

When we draw in the future to alternative framebuffers which do not have back
buffers this call is fatal.

Test Plan: No tearing on Wayland, tearing as before on X11.

Reviewers: #kwin, davidedmundson

Reviewed By: #kwin, davidedmundson

Subscribers: kwin

Tags: #kwin

Differential Revision: https://phabricator.kde.org/D25868
2019-12-11 15:47:26 +01:00
Méven Car
930c2d69a7 [KCM/Desktop] Use KConfig XT to store virtualdesktops related settings
Summary: Use a kcfg file to specify virtual desktops settings saved to kwinrc.

Test Plan:
kcmshell5 kcm_kwin_virtualdesktops
Change something, check apply buttons works appropriately
Save the settings and relaunch the kcm, the new settings are taken loaded correctly

Reviewers: #kwin, ervin

Reviewed By: ervin

Subscribers: kwin

Tags: #kwin

Differential Revision: https://phabricator.kde.org/D25871
2019-12-11 11:00:38 +01:00
Aleix Pol
f6128ec875 Provide a fake approach to tablet event propagation
Summary:
At the moment, the state of wayland of getting such events isn't all
that clear. There's a zwp_tablet protocol that isn't stable yet and more
importantly isn't supported by Qt just yet.
Have it move and click the mouse about for now.

Depends on D25663 and D25763

Reviewers: #kwin, romangg

Reviewed By: #kwin, romangg

Subscribers: romangg, zzag, kwin

Tags: #kwin

Differential Revision: https://phabricator.kde.org/D25764
2019-12-10 21:59:05 +01:00
Aleix Pol
4172ef3b30 Turn switch statement into a hash
Summary: This way we can reverse-lookup if we ever want the opposite information.

Reviewers: #kwin, romangg

Reviewed By: #kwin, romangg

Subscribers: zzag, kwin

Tags: #kwin

Differential Revision: https://phabricator.kde.org/D25763
2019-12-10 21:57:09 +01:00
Aleix Pol
f5a73b87e3 Initial support for tablets on Wayland
Summary:
This includes support for them on libinput and turns it into fake
pointer actions.
This doesn't implement zwp_tablet, this will have to happen in an
iteration later.

Test Plan:
Been playing around with it, see video.
https://www.youtube.com/watch?v=GF1WbO8FVvU

Reviewers: #plasma, #kwin, romangg

Reviewed By: #plasma, #kwin, romangg

Subscribers: zzag, davidedmundson, romangg, kwin

Tags: #kwin

Differential Revision: https://phabricator.kde.org/D25663
2019-12-10 21:56:31 +01:00
David Edmundson
5114494b57 [effects/startupfeedback] Port to KConfigWatcher
Summary:
startupfeedback is a special case, rather than loading our own config we
load settings from klaunchrc.

In order to reload this means leaking kwin specific calls into the
launch feedback KCM. Using the new KConfigWatcher syntax, we can use a
generic solution for all this code.

Test Plan:
Changed the value in KCM
Opened dolphin
cursor did the right thing

Reviewers: zzag

Reviewed By: zzag

Subscribers: kwin

Tags: #kwin

Differential Revision: https://phabricator.kde.org/D25834
2019-12-10 11:21:23 +00:00
Roman Gilg
fde3b1f6bb [platforms/drm] Do EglGbmBackend chore
Summary:
This is a small overhaul of the EglGbmBackend. Functions are restructured,
white space added and variables renamed for better readability and style
aligned with Frameworks Coding Style.

Test Plan: Session starts.

Reviewers: #kwin, zzag

Reviewed By: #kwin, zzag

Subscribers: kwin

Tags: #kwin

Differential Revision: https://phabricator.kde.org/D25830
2019-12-10 11:00:59 +01:00
l10n daemon script
cab72500b5 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"
2019-12-10 09:23:03 +01:00
l10n daemon script
27ba893b75 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"
2019-12-10 05:51:14 +01:00
l10n daemon script
44f6b70245 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"
2019-12-07 05:38:05 +01:00
Vlad Zagorodniy
1747e497e4 [effects/fallapart] Override scale, fade, and glide effect
Summary:
Currently the fall apart effect doesn't work in conjuction with window
open/close animation effects, e.g. scale. The reason for that is those
effects grab windows before the fall apart effect.

Test Plan:
* Enable the fall apart effect and the scale effect;
* Close a window.
(without this patch the window doesn't fall apart)

Reviewers: #kwin, davidedmundson

Reviewed By: #kwin, davidedmundson

Subscribers: ngraham, davidedmundson, kwin

Tags: #kwin

Differential Revision: https://phabricator.kde.org/D19723
2019-12-06 11:01:18 +02: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
d6469fb55d [x11] Resize the shape helper window to correct size
Summary:
The frame geometry doesn't necessarily correspond to the server-side
geometry of the toplevel window, we need to use the buffer geometry
instead.

Reviewers: #kwin, davidedmundson

Reviewed By: #kwin, davidedmundson

Subscribers: kwin

Tags: #kwin

Differential Revision: https://phabricator.kde.org/D25730
2019-12-04 12:18:36 +02:00
Vlad Zahorodnii
f14adfe545 [x11] Make geometry updates in X11Client more comprehensible
Summary:
This change makes geometry updates in the X11Client class simpler and
also fixes a bug in the move() method.

Test Plan: All tests pass.

Reviewers: #kwin

Subscribers: kwin

Tags: #kwin

Differential Revision: https://phabricator.kde.org/D25710
2019-12-04 10:06:59 +02:00
Mikhail Zolotukhin
d3da912d72 Notify about window decorations buttons order changes
Summary:
This makes it possible to detect these changes via KConfigWatcher.

This is needed for D25670

Reviewers: #kwin, ngraham, davidedmundson

Reviewed By: #kwin, ngraham, davidedmundson

Subscribers: ngraham, kwin

Tags: #kwin

Differential Revision: https://phabricator.kde.org/D25695
2019-12-03 12:10:10 -07:00
Vlad Zahorodnii
297876e55e Split group.cpp topic file
Test Plan: Compiles.

Reviewers: #kwin, romangg

Reviewed By: #kwin, romangg

Subscribers: kwin

Tags: #kwin

Maniphest Tasks: T12312

Differential Revision: https://phabricator.kde.org/D25713
2019-12-03 19:43:47 +02:00
Vlad Zahorodnii
30c14d6e43 Merge manage.cpp with x11client.cpp
Test Plan: Compiles.

Reviewers: #kwin, romangg

Reviewed By: #kwin, romangg

Subscribers: kwin

Tags: #kwin

Maniphest Tasks: T12312

Differential Revision: https://phabricator.kde.org/D25712
2019-12-03 17:52:58 +02:00
Jonathan Riddell
22abd0d263 Update version number for 5.17.4
GIT_SILENT
2019-12-03 11:47:22 +00:00
l10n daemon script
3a43ae1680 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"
2019-12-03 09:26:22 +01:00