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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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