Commit graph

16986 commits

Author SHA1 Message Date
Antonio Rojas
94d2fea23a Move knsrc files to the new location
Instead of the old legacy /etc/xdg location

Differential Revision: https://phabricator.kde.org/D21254
2019-05-17 18:56:27 +02:00
Jonathan Riddell
7c1a7c35f3 Update version number for 5.15.90
GIT_SILENT
2019-05-16 11:00:42 +01:00
Jonathan Riddell
0c67056708 bump Qt version to 5.12 as agreed at start of cycle 2019-05-16 10:13:14 +01:00
Vlad Zagorodniy
d94eb29d07 [effects/thumbnailaside] Specify screen projection matrix
Summary:
The Lanczos filter is applied to thumbnails, so we need to specify screen
projection matrix in order to properly project window coordinates into
screen-space.

BUG: 407485

Reviewers: #kwin, davidedmundson

Reviewed By: #kwin, davidedmundson

Subscribers: kwin

Tags: #kwin

Differential Revision: https://phabricator.kde.org/D21224
2019-05-15 12:35:00 +03:00
Vlad Zagorodniy
67b2746ecd Compute correct boundaries in checkWorkspacePosition
Summary:
When a client sets a strut, checkWorkspacePosition will be called to
bump clients that touch corresponding screen edge.

In order to do that, checkWorkspacePosition needs to calculate client
boundaries before and after the restricted move area was changed. As it
turns out, if the client reserves space "between" screens, calculated
boundaries can be incorrect, which may lead to some funky results, e.g.
shrunken clients.

For example, let's say that there is a dual-monitor setup. If a client
reserves some amount of space at the right border of the left screen,
then clients on the right monitor will have rightMax which is equal to
the x coordinate of screenArea.

To fix that, this change ensures that only restricted areas belonging
to the same screen as the client are taken into account when computing
the boundaries.

BUG: 404837
BUG: 406573

Reviewers: #kwin, davidedmundson

Reviewed By: #kwin, davidedmundson

Subscribers: kwin

Tags: #kwin

Differential Revision: https://phabricator.kde.org/D20987
2019-05-15 11:07:14 +03:00
Vlad Zagorodniy
0aa288bfae Port away from deprecated qFind
Test Plan: Compiles, the number of compiler warnings has been reduced from 990 to 202.

Reviewers: #kwin, apol, davidedmundson

Reviewed By: #kwin, apol, davidedmundson

Subscribers: kwin

Tags: #kwin

Differential Revision: https://phabricator.kde.org/D21217
2019-05-15 11:03:29 +03:00
David Edmundson
24cbe48656 Revert "Handle XdgShell window geometry in configure request sizes"
This reverts commit bc83065ceb.

Turns out the relevant wayland code wasn't merged. This will have to
wait till next plasma for a fix.
2019-05-10 21:43:08 +01:00
David Edmundson
bc83065ceb Handle XdgShell window geometry in configure request sizes
Summary:
The size passed to an XDG shell configure request should match the
window size of the given window, we don't want to include the size of
any shadows that may be drawn by the client.

Kwin has the same concept of geometry for both window management, input
and rendering.

In order to approach this in a way that does not risk any regressions
with kwin's current structure AbstractClient::geometry remains the
canonical source and we handle the window within that internally within
ShellClient treating the windowGeometry as a set of margins from this.

This is part of a much bigger task (T10867). This patch addresses
windows growing when starting a drag based resize.

BUG: 403376

Test Plan:
Unit test
gtk3-demo

Reviewers: #kwin, zzag

Reviewed By: #kwin, zzag

Subscribers: zzag, kwin

Tags: #kwin

Differential Revision: https://phabricator.kde.org/D20937
2019-05-10 16:34:43 +01:00
David Edmundson
ce1a5eae15 Support NET_WM_STATE_FOCUSED
Summary:
This is used by GTK clients to know whether to draw as though they have
focus or not. Whilst it's most visible for CSDs headers, use of the
active/inactive palette (or backdrop class in GTK terms) applies
everywhere.

Rationale of the flag is to allow the WM to hint visual states without
giving input, i.e so you can hint that the parent of a modal dialog
should be shown as active. Though kwin only sets it on the truly active
window to match the behaviour our other windows follow.

BUG: 398832

I expect this to be potentially controversial as it's new code in X11,
so in advance:

* Unlike GTK_FRAME_EXTENTS, it is part of the specificiation (albeit
1.4) even i3 supports it.

* It does fix a real world issue

* It's only 2 lines (plus trivial boiler plate in kwindowsystem)

* It's in code path that we rely on for our existing code

* If there's a situation where this does break, the worst that will
happen is a client gets a visual hint to have focus incorrectly, which
ultimately is the same as the current state

Test Plan:
Used my CSS for breeze-gtk
moved between windows

Reviewers: #kwin, rooty, zzag

Reviewed By: #kwin, zzag

Subscribers: zzag, ognarb, ngraham, rooty, graesslin, kwin

Tags: #kwin

Differential Revision: https://phabricator.kde.org/D19613
2019-05-10 15:32:55 +01:00
Harald Sitter
988ca97c96 Update kf5 version requirement to 5.58.0
GIT_SILENT
2019-05-09 15:09:32 +02:00
Fabian Vogt
7804eb41d9 Fix crash due to dangling reference
Summary:
Returning a reference to a value on the stack is broken.
This caused kwin_wayland to crash in openQA with a nullptr deref.

BUG: 407199

Test Plan: Only build tested.

Reviewers: #kwin, zzag

Reviewed By: #kwin, zzag

Subscribers: kwin

Tags: #kwin

Differential Revision: https://phabricator.kde.org/D21085
2019-05-08 19:15:05 +02:00
l10n daemon script
ee60653640 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-05-08 05:51:51 +02:00
Vlad Zagorodniy
e8b45cce11 [effects/cubeslide] Cancel active animation when number of desktops has changed
Summary:
If a virtual desktop is removed, then desktopChanged will be followed by
numberDesktopsChanged signal. In which case, we have to cancel the
active animation because front_desktop might be no longer valid when
it's time to perform compositing.

BUG: 406452

Reviewers: #kwin, davidedmundson

Reviewed By: #kwin, davidedmundson

Subscribers: kwin

Tags: #kwin

Differential Revision: https://phabricator.kde.org/D21064
2019-05-07 15:13:09 +03:00
Vlad Zagorodniy
c438ecbb70 Don't crash when highlighted tabbox client is closed
Summary:
The compositor tries to switch to the next tabbox client when currently
highlighted client is closed. Though there is a small issue with that.
Because the switch happens too late, a dangling pointer can be inserted
into the unconstrained stacking order, which can lead to a crash later on.

There are two cases:
- compositing is on;
- compositing is off.

Compositing is on: TabBox will try to un-elevate currently highlighted
client, though by that time the client no longer owns EffectWindow, so
this is basically a no-op (that's why we haven't experienced this bug
before).

Compositing is off: TabBox will try to restack currently hightlighted
client under the next tabbox client. Given that the restack method
doesn't do any sanity checks(see Client::manage why), a client that is
about to be destroyed will be re-inserted back into the unconstrained
stacking order.

This change ensures that the switch happens before currently highlighted
client is removed from the stacking order.

BUG: 406784

Test Plan:
- Turn off compositing;
- Follow steps to reproduce in the bug report (see comment 2).

Reviewers: #kwin, davidedmundson

Reviewed By: #kwin, davidedmundson

Subscribers: kwin

Tags: #kwin

Differential Revision: https://phabricator.kde.org/D20916
2019-05-03 21:25:13 +03:00
Vlad Zagorodniy
0fb09cf413 Make session loading/saving helpers local to sm.cpp
Summary:
There is no point for keeping them in the Workspace class because they
are used only in sm.cpp.

Test Plan: Compiles.

Reviewers: #kwin, davidedmundson

Reviewed By: #kwin, davidedmundson

Subscribers: kwin

Tags: #kwin

Differential Revision: https://phabricator.kde.org/D20783
2019-05-03 21:24:07 +03:00
Nate Graham
48cacae8cf [kcmkwin/kwindecoration] Refine drag-and-drop button UI
Summary:
- Reduce the fake titlebar's height so it matches the real titlebar a bit better
- Reduce background opacity while dropping button to diminish visual noise
- Increase label size
- Re-word label for greater clarity
- Remove redundant icon (the text is enough)

BUG: 407109
FIXED-IN: 5.16.0

Test Plan: {F6804068, size=full}

Reviewers: #vdg, #kwin, GB_2, davidedmundson

Reviewed By: #vdg, #kwin, GB_2, davidedmundson

Subscribers: GB_2, abetts, kwin

Tags: #kwin

Differential Revision: https://phabricator.kde.org/D20968
2019-05-02 17:07:22 -06:00
Kai Uwe Broulik
df85907de3 Support CriticalNotification type and place it in a CriticalNotificationLayer
Differential Revision: https://phabricator.kde.org/D20629
2019-05-02 10:29:38 +02:00
l10n daemon script
cc81964fce 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-05-02 05:57:21 +02:00
Aleix Pol
559c2e68d3 Improve behavior of rotated displays
Reviewers: #kwin, davidedmundson

Reviewed By: #kwin, davidedmundson

Subscribers: zzag, kwin

Tags: #kwin

Differential Revision: https://phabricator.kde.org/D20255
2019-04-26 13:10:41 +02:00
Christoph Feck
6a53658d49 Merge remote-tracking branch 'origin/Plasma/5.15' 2019-04-26 10:59:40 +02:00
Christoph Feck
57440d1d6b Fix captions with non-BMP characters
KWin replaces any non-printable character with a space. This check does not
handle surrogate pairs correctly. Additionally, translators sometimes insert
non-printable soft-hyphens into titles, which also cause KWin to display a
space instead.

This code adds the missing surrogate handling, and (to fix both issues), also
removes non-printable characters instead of replacing them with a space.

Also moved the changed test after these changes, so that changes in non-
printable characters do not cause unneeded redraws.

Unit tests adapted by Vlad Zagorodniy.

Test Plan:

kwrite /tmp/Test😣.txt shows correct title. I also tested actual non-printable
characters, such as 0x1A, and these are correctly omitted.

BUG: 376813
FIXED-IN: 5.15.5

Reviewers: #kwin, zzag

Reviewed By: #kwin, zzag

Subscribers: zzag, grasslin, kwin

Tags: #kwin

Differential Revision: https://phabricator.kde.org/D19052
2019-04-26 10:52:57 +02:00
Nate Graham
4725ece602 [kcmkwin/kwintabbox] Use a more appropriate icon
Summary:
The current icon (`window-duplicate`) is semantically incorrect and visually disconnected from what it actually does.

This one is much more appropriate on both counts.

Test Plan: {F6792003, size=full}

Reviewers: #vdg, #kwin, zzag

Reviewed By: #kwin, zzag

Subscribers: zzag, kwin

Tags: #kwin

Differential Revision: https://phabricator.kde.org/D20801
2019-04-25 07:23:12 -06:00
Vlad Zagorodniy
b37743d8b1 Delete noop code
Summary:
checkWorkspacePosition has a guard again desktop clients right at the
top, so the for loop is basically a no-op.

Reviewers: #kwin, davidedmundson

Reviewed By: #kwin, davidedmundson

Subscribers: kwin

Tags: #kwin

Differential Revision: https://phabricator.kde.org/D20777
2019-04-25 11:14:48 +03:00
Vlad Zagorodniy
70b9c3651a Refactor getters in OutputScreens
Summary:
kdelibs coding style recommends to avoid abbreviations, i.e. variable
names like compMngr, errStr, and so on are bad. Unfortunately, all
getters in OutputScreens don't follow that recommendation. In general,
we could address this issue by renaming enOuts but there is a bit simpler
approach to implement most of those getters.

Reviewers: #kwin, davidedmundson

Reviewed By: #kwin, davidedmundson

Subscribers: apol, kwin

Tags: #kwin

Differential Revision: https://phabricator.kde.org/D20588
2019-04-25 11:12:25 +03:00
David Edmundson
aa11e4f777 Avoid duplicating screensaver interface definition file
Summary:
Kwin has a mandatory dependency on kscreenlocker, we can use the
screensaver interface definition installed from there.

Test Plan: Compiles

Reviewers: #kwin, zzag

Reviewed By: #kwin, zzag

Subscribers: kwin

Tags: #kwin

Differential Revision: https://phabricator.kde.org/D20764
2019-04-25 00:45:21 +01:00
Aleix Pol
d3275784a8 Don't rescale every output every time outputs change
Summary:
Every time a display gets connected/disconnected, every output will be
reinitialized. We don't really need to reset the scaling to 1 every time
we don't know, especially since the setting has been set voluntarily.

Test Plan: When I disconnect the external display, my laptop doesn't fallback to scale=1.

Reviewers: #plasma, apol

Reviewed By: apol

Subscribers: davidedmundson, ngraham, kwin

Tags: #kwin

Differential Revision: https://phabricator.kde.org/D20521
2019-04-25 00:45:14 +01:00
David Edmundson
c4ab885616 Initialise XdgOutput properties on creation
Summary:
initWaylandOutput can be called before or after all properites are set.
If it's called after, we need to still have xdgOuput set correctly.

Test Plan:
Simplified Aleix's patch that avoids a no-op setScale call
Now it works.

Reviewers: #kwin, apol

Reviewed By: apol

Subscribers: kwin

Tags: #kwin

Differential Revision: https://phabricator.kde.org/D20800
2019-04-25 00:45:06 +01:00
Vlad Zagorodniy
32863aac9b Use AbstractClient::Position instead of Client::Position
Test Plan: Compiles.

Reviewers: #kwin, davidedmundson

Reviewed By: #kwin, davidedmundson

Subscribers: kwin

Tags: #kwin

Differential Revision: https://phabricator.kde.org/D20778
2019-04-24 02:26:56 +03:00
Vlad Zagorodniy
fd20c59ada Make Compositor::finish more generic
Summary:
KWin is not only an X11 compositing window manager, but also a Wayland
compositor. The Compositor class is used in both cases so in general it
would be nice to keep it as much as possible generic.

Reviewers: #kwin, davidedmundson

Reviewed By: #kwin, davidedmundson

Subscribers: kwin

Tags: #kwin

Differential Revision: https://phabricator.kde.org/D19879
2019-04-24 00:02:40 +03:00
Vlad Zagorodniy
b617613bf7 [scenes/opengl] Ensure there is current OpenGL context when destroying EffectFrame unstyled texture
Summary: BUG: 406671

Reviewers: #kwin, davidedmundson

Reviewed By: #kwin, davidedmundson

Subscribers: kwin

Tags: #kwin

Differential Revision: https://phabricator.kde.org/D20723
2019-04-23 23:59:27 +03:00
Vlad Zagorodniy
e4456347c4 Fix corner screen glows that suddenly pop up
Summary:
Depending on how pointer approaches a screen corner, the maximum
distance between two may be smaller than 2 * edgeDistance. This can
happen for example when approaching the corner along of any two adjacent
screen edges.

As a result, the calculated factor can be anywhere between 0 and 0.5
when pointer enters approachGeometry(). This change adjusts calculation
of the factor, so it always ranges from 0 to 1 no matter how the pointer
approaches corners.

Reviewers: #kwin, davidedmundson

Reviewed By: #kwin, davidedmundson

Subscribers: kwin

Tags: #kwin

Differential Revision: https://phabricator.kde.org/D20707
2019-04-23 23:57:13 +03:00
Aleix Pol
bf6f05bf3c Initialise the orientation sensor at start
Summary: We want to set the right orientation as the system starts.

Reviewers: #plasma, #kwin, zzag, davidedmundson

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

Subscribers: zzag, kwin

Tags: #kwin

Differential Revision: https://phabricator.kde.org/D20622
2019-04-23 14:46:23 +02:00
Kai Uwe Broulik
3323857a64 Merge branch 'Plasma/5.15' 2019-04-23 11:00:14 +02:00
Kai Uwe Broulik
97c3cb73ff [libkwineffects] Use fully qualified type name for signal
Qt Script Engine isn't particularly smart at resolving namespaces.

Differential Revision: https://phabricator.kde.org/D20733
2019-04-23 10:54:49 +02:00
Vlad Zagorodniy
abe128818c Use more accurate name for Workspace::getMovingClient method
Summary:
The name of Workspace::getMovingClient() method implies that the
returned value is a client that is currently being moved around
by the user, but this is of course incorrect.

Reviewers: #kwin, apol

Reviewed By: apol

Subscribers: apol, kwin

Tags: #kwin

Differential Revision: https://phabricator.kde.org/D20663
2019-04-22 11:12:22 +03:00
Vlad Zagorodniy
2028855517 [libkwineffects] Bump api version
Summary:
libkwineffects in master is no longer ABI compatible with 0.227 because
order of virtual methods in EffectsHandler and EffectWindow had been
changed.

Reviewers: #kwin, davidedmundson

Reviewed By: #kwin, davidedmundson

Subscribers: kwin

Tags: #kwin

Differential Revision: https://phabricator.kde.org/D20652
2019-04-18 14:24:01 +03:00
l10n daemon script
80c17e43d1 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-04-18 06:12:39 +02:00
Friedrich W. H. Kossebau
1fb4baf365 [effects/screenedge] Support "hint-stretch-borders"
Summary:
Some old themes have the flag set and also a style which expects the
borders to be stretched. Given that the documentation on techbase
describes widgets/glowbar still as "a frame without a prefix", one also
would assume that all the optional hints (which make sense) still apply.
Even more, the Air & Oxygen themes have the hint also set, though for
their rendering it makes no difference.
The small code needed seems worth the unbreaking of old themes as well
as giving theme creators another variable of freedom for their styles.

Test Plan:
Glow bar still works on all corners and edges with all themes as before,
though rendering now as expected for themes which have the
"hint-stretch-borders" set.

Reviewers: #kwin, zzag, davidedmundson

Reviewed By: #kwin, zzag, davidedmundson

Subscribers: davidedmundson, zzag, kwin

Tags: #kwin

Differential Revision: https://phabricator.kde.org/D20621
2019-04-17 15:22:15 +02:00
l10n daemon script
bdbb471851 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-04-17 08:50:30 +02:00
Vlad Zagorodniy
8010e076ee Revert "Move keep-above clients to the Normal layer when showing desktop"
This reverts commit 1e2a0028c3.

Unfortunately, we can't move clients from the above layer to the normal
layer because some of those clients have to be visible when showing
desktop, one such client for example is krunner.

CCBUG: 406101
2019-04-16 11:10:20 +03:00
Vlad Zagorodniy
af862a9caf Remove redundant AbstractOutput::internal() method
Summary: We already have AbstractOutput::isInternal() method.

Reviewers: #kwin, davidedmundson

Reviewed By: #kwin, davidedmundson

Subscribers: kwin

Tags: #kwin

Differential Revision: https://phabricator.kde.org/D20587
2019-04-16 10:13:38 +03:00
Vlad Zagorodniy
0db071c218 Move Unmanaged-specific hack away from Toplevel::setupCompositing
Reviewers: #kwin, davidedmundson

Reviewed By: #kwin, davidedmundson

Subscribers: kwin

Tags: #kwin

Differential Revision: https://phabricator.kde.org/D20590
2019-04-16 10:12:30 +03:00
Erik Kurzinger
c898f96df3 [platforms/drm] EGLStream DRM Backend Initial Implementation
Summary:
This is the initial implementation of a DRM backend based on the EGLDevice,
EGLOutput, and EGLStream extensions, supporting NVIDIA graphics hardware using
their proprietary driver. The new backend will be used if the environment
variable KWIN_DRM_USE_EGL_STREAMS is set. On initialization, it will attempt to
create an EGLDevice based on the DRM device currently in use and create
EGLOutputs and EGLStreams for any attached displays. These are used to control
presentation of the final composited frame. Additionally, it will register the
wl_eglstream_controller Wayland interface so that native EGL windows created by
clients can be attached to an EGLStream allowing buffer contents to be shared
with the compositor as a GL texture.

At this time there are two known bugs in the NVIDIA driver's EGL implementation
affecting desktop functionality. The first can result in tooltip windows drawn
by plasmashell to contain incorrect contents. The second prevents KWayland from
being able to query the format of EGLStream-backed buffers which interferes
with the blur effect. Fixes for both of these are currently in development and
should appear in an upcoming NVIDIA driver release.

Additionally, hardware cursors are currently not supported with this backend.
Enabling them causes the desktop to intermittently hang for several seconds.
This is also likely a bug in the NVIDIA DRM-KMS implementation but the root
cause is still under investigation.

Test Plan:
On a system with an NVIDIA graphics card running a recent release of their
proprietary driver

    * Ensure the nvidia_drm kernel module is loaded with the option "modeset=1"
      ("# cat /sys/module/nvidia_drm/parameters/modeset" should print "Y")
    * Ensure EGL external platform support is installed
      https://github.com/NVIDIA/eglexternalplatform
    * Ensure KWin was build with the CMake option
      KWIN_BUILD_EGL_STREAM_BACKEND=ON (this is the default)
    * Start a plasma wayland session with the environment variable
      KWIN_DRM_USE_EGL_STREAMS set
    * Ensure output from KWin OpenGL initialization indicates the NVIDIA EGL
      driver is in use (as opposed to Mesa / llvmpipe).
    * Desktop should be fully functional and perform smoothly.

Reviewers: #kwin, romangg, davidedmundson

Reviewed By: #kwin, romangg, davidedmundson

Subscribers: kwin

Tags: #kwin

Differential Revision: https://phabricator.kde.org/D18570
2019-04-15 07:26:22 -07:00
Vlad Zagorodniy
e3d1ddd2bf Merge branch 'Plasma/5.15' 2019-04-15 11:20:19 +03:00
Vlad Zagorodniy
0a8c436f7f [effects/fallapart] Don't animate popups
Summary: BUG: 405971

Reviewers: #kwin, davidedmundson

Reviewed By: #kwin, davidedmundson

Subscribers: kwin

Tags: #kwin

Differential Revision: https://phabricator.kde.org/D20568
2019-04-15 11:20:06 +03:00
l10n daemon script
6b769152d3 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-04-12 09:04:10 +02:00
l10n daemon script
ef3f1e57ba 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-04-12 05:58:07 +02:00
Erik Kurzinger
a1e8541b49 [qpa] Don't specify EGL_SURFACE_TYPE when choosing EGLConfig
Summary:
Since QPA only performs off-screen rendering, it does not require an EGLConfig
that supports any particular surface type.  Currently it requests a config
supporting window surfaces, however the EGLDeviceEXT platform, which is the
basis of the EGLStream back-end used with the proprietary NVIDIA driver, does
not support such surfaces resulting in eglChooseConfig not returning any valid
configs when that back-end is in use. Since QPA doesn't actually create any
window surfaces, it should be fine to remove this restriction to allow it to
initialize properly with the EGLStream back-end.

Reviewers: #kwin, davidedmundson

Reviewed By: #kwin, davidedmundson

Subscribers: kwin, davidedmundson

Tags: #kwin

Differential Revision: https://phabricator.kde.org/D20455
2019-04-11 07:43:31 -07:00
Vlad Zagorodniy
dd8a0407ca [kcmkwin] Actually save effect settings
As part of an effort to unify effect KCM logic, code that actually saves
effect settings unfortunately got lost. Sorry for that.
2019-04-10 11:40:46 +03:00
Aleix Pol
21a62f0b38 Make the Keyboard Layout SNI passive
Summary:
This one only appears on wayland and doesn't offer much functionality.
On the extended part of the system tray at least we'll know what it is.

Reviewers: #plasma, ngraham

Reviewed By: ngraham

Subscribers: kwin

Tags: #kwin

Differential Revision: https://phabricator.kde.org/D20369
2019-04-09 23:38:52 +02:00