On modern machines session startup takes a few seconds where the 2s might artificially slow down the process by like 50%.
This makes the animation quicker to make the system feel ready quicker.
Differential Revision: https://phabricator.kde.org/D21904
Summary:
QtQuick windows created by KWin currently use the default swap interval
of 1, meaning buffer swaps will block until vblank. However, this
results in a problematic interaction on hybrid graphics systems running
the proprietary NVIDIA driver. VSync on such setups relies on a system
called "PRIME synchronization", where the xf86-video-modesetting driver
controlling the display will signal the NVIDIA driver when vblank has
occurred. The issue is that it will only do so if there has been damage
to the screen.
So, when KWin creates a QtQuick window, compositing will stop waiting on
the window to render, therefore no damage to the screen will occur. But
this means that no vblank notifications will be delivered to the NVIDIA
driver, so the glXSwapBuffers call by the QtQuick window will block
perpetually. The end result is a freeze of the desktop.
To get around this, we can simply disable vsync for QtQuick windows by
setting the swap interval for the default QSurfaceFormat to 0. Since
they are redirected, this shouldn't cause any tearing.
BUG: 406180
FIXED-IN: 5.16.2
Test Plan:
Using the proprietary NVIDIA driver on a hybrid graphics system, with
PRIME synchronization enabled (see
https://devtalk.nvidia.com/default/topic/957814/linux/prime-and-prime-synchronization/),
perform any action causing a QtQuick window to be created by KWin, for
example, triggering the application switcher dialogue with alt + tab.
Ensure the desktop does not temporarily freeze.
Note, this required a Qt build that includes commit
https://code.qt.io/cgit/qt/qtbase.git/commit/?id=0c1831178540462da31fd7a4b6d2e446bc84498b
resolving a bug that prevented the changing the swap interval.
Reviewers: #kwin, davidedmundson, zzag
Reviewed By: #kwin, davidedmundson, zzag
Subscribers: zzag, romangg, alexeymin, kwin
Tags: #kwin
Differential Revision: https://phabricator.kde.org/D21808
Summary:
There are several issues with code of AbstractOutput class:
(a) Some methods are documented, and some are not. In general, we tend
to document all public methods in KWin core. It looks like a very
minor issue, but there are methods that have very ambiguous return
value. One such method is geometry(). It's not obvious whether the
returned geometry is in device independent pixels or not;
(b) There's a mix of methods defined in the cpp file and in the header.
This is not very good because reading such code becomes a bit harder
if you don't use any fancy IDE;
(c) Missing Q_DISABLE_COPY, etc.
This change addresses these issues, so the code is a bit more readable
and easier to work with.
Reviewers: #kwin, davidedmundson
Reviewed By: #kwin, davidedmundson
Subscribers: broulik, cfeck, davidedmundson, kwin
Tags: #kwin
Differential Revision: https://phabricator.kde.org/D21874
Summary:
The color correction manager doesn't make any specific assumptions about
underlying platform, e.g. whether it's x11, etc. The platform just
has to be capable of setting gamma ramps. Given that, there are no any
significant technical blockers for making this feature work on x.
Reviewers: #kwin, davidedmundson, romangg
Reviewed By: #kwin, davidedmundson, romangg
Subscribers: romangg, neobrain, GB_2, filipf, davidedmundson, ngraham, kwin
Tags: #kwin
Differential Revision: https://phabricator.kde.org/D21345
Summary:
After porting all platforms to using AbstractOutput the BasicScreens
class is not needed anymore.
Test Plan: Compiles
Reviewers: #kwin, zzag
Reviewed By: #kwin, zzag
Subscribers: kwin
Tags: #kwin
Maniphest Tasks: T11098
Differential Revision: https://phabricator.kde.org/D21800
In 1a11abc821 some function calls in the createXdgOutput function were
accidentally removed resulting in possibility of broken setup on startup.
Add these calls back again.
Summary:
Represent outputs in the X11 session via AbstractOutput. For that we
move all Wayland specific parts of AbstractOutput into a new subclass
AbstractWaylandOutput and let the outputs of our Wayland backends inherit
from there.
This should allow us to get rid of the Screens class later on.
Test Plan: Manually in X session.
Reviewers: #kwin, zzag, davidedmundson
Reviewed By: #kwin, zzag, davidedmundson
Subscribers: ngraham, zzag, kwin
Tags: #kwin
Differential Revision: https://phabricator.kde.org/D19208
Summary:
To homogenize our backends and as another step to remove the Screens class
use the AbstractOutput class in the windowed X11 backend.
Test Plan: Manually in X session.
Reviewers: #kwin, zzag
Reviewed By: #kwin, zzag
Subscribers: davidedmundson, zzag, kwin
Tags: #kwin
Differential Revision: https://phabricator.kde.org/D19207
Summary:
Since KSnapshot is no longer used, I modified the text in `effect_builtins.cpp` to reflect that, changing it to a generic "screenshot tools".
BUG: 408407
FIXED-IN: 5.17.0
Reviewers: #kwin, davidedmundson
Reviewed By: #kwin, davidedmundson
Subscribers: filipf, davidedmundson, kwin
Tags: #kwin
Differential Revision: https://phabricator.kde.org/D21700
Since d51b8dc093 the test fails on CI, apparently because we test with
Breeze default settings, which is no borders now and we can move a bit into
the window geometry and still be on the border if borders exist, otherwise
not.
For now fix it by checking if there are borders or not and then test
accordingly. But long-term we should test both cases and besides not rely on
external decorations for our test, instead use a fake specific for our
integration testing.
Summary:
XWayland clients have a surface associated with them asynchronously. In this
case we don't directly want to set focus on this Toplevel, but wait until the
surface is set.
This patch aims in conjunction with an unrelated fix to SDL at improving Steam
Big Picture Mode in our Wayland session.
Test Plan: Steam BPM regains focus on game close.
Reviewers: #kwin, zzag
Reviewed By: #kwin, zzag
Subscribers: anthonyfieroni, davidedmundson, zzag, kwin
Tags: #kwin
Differential Revision: https://phabricator.kde.org/D19262
Summary:
To homogenize our backends and as another step to remove the Screens class
use the AbstractOutput class in the framebuffer backend.
Test Plan: Manually on VT enforcing the framebuffer backend.
Reviewers: #kwin, davidedmundson
Reviewed By: #kwin, davidedmundson
Subscribers: davidedmundson, kwin
Tags: #kwin
Differential Revision: https://phabricator.kde.org/D19199
Summary:
If a user has set his border size explicitly in the past also respect this
selection with the new auto border size mode by setting auto borders to
false on update.
For this a kconf_update file and a sed based shell script is added.
Test Plan: Manually.
Reviewers: #kwin, davidedmundson
Reviewed By: #kwin, davidedmundson
Subscribers: zzag, davidedmundson, kwin
Tags: #kwin
Maniphest Tasks: T8707
Differential Revision: https://phabricator.kde.org/D13480
Summary:
This is an alternative solution to T8707 and in comparision to D13276 a less
drastic change to KWin's default behavior.
Instead of changing the border size default for all KDecoration plugins by
switching the default from border size Normal to None introduce new
functionality, which allows a KDecoration plugin to recommend a border size in
its metadata. By default KWin listens for these recommendations and sets the
border size accordingly.
If there is no metadata recommending a border size, KWin falls back to the
current setting of Normal sized borders.
A user is able to override the recommendations from the KCM, which has been
extended accordingly.
Test Plan: Manually with adjusted metadata of Breeze.
Reviewers: #kwin, #plasma, #vdg, ngraham
Reviewed By: #vdg, ngraham
Subscribers: hpereiradacosta, filipf, anemeth, davidedmundson, abetts, graesslin, ngraham, zzag, kwin
Tags: #kwin
Maniphest Tasks: T8707
Differential Revision: https://phabricator.kde.org/D13284
Summary:
This adds again the workaround from 1fb2eace3f, which got temporarily
removed by 9b922f8833.
BUG: 386304
Test Plan: Manually
Reviewers: #kwin
Subscribers: kwin
Tags: #kwin
Differential Revision: https://phabricator.kde.org/D21601
Summary: Otherwise it's hard to tell if it failed.
Test Plan: Found out that my session was crashing.
Reviewers: #kwin, zzag
Reviewed By: #kwin, zzag
Subscribers: zzag, kwin
Tags: #kwin
Differential Revision: https://phabricator.kde.org/D21465
Summary:
xcb_put_image doesn't handle big images well. Contrary to XPutImage, the
caller must manually split the data in such a way that each xcb_put_image
request doesn't exceed the maximum request length. Not doing so will result
in libxcb shutting down the connection.
CCBUG: 338489
CCBUG: 388182
Test Plan: Take a screenshot of an active fullscreen client on a 4K monitor.
Reviewers: #kwin, davidedmundson
Reviewed By: #kwin, davidedmundson
Subscribers: davidedmundson, kwin
Tags: #kwin
Differential Revision: https://phabricator.kde.org/D21370
Summary:
Currently, if a script relies on clientAdded to setup some required
connections, then it probably won't work with Wayland clients because
clientAdded is emitted only for X11 clients.
Test Plan:
* Installed sticky window snapping script, it works;
* Installed a couple of tiling scripts, with some small changes, they work.
Reviewers: #kwin, davidedmundson
Reviewed By: #kwin, davidedmundson
Subscribers: strobach, TomButler, davidedmundson, mart, graesslin, kwin
Tags: #kwin
Differential Revision: https://phabricator.kde.org/D17097
Currently, clientArea(ClientAreaOption, const Client *) and clientList()
are quite X11-specific, which results in having some tiling scripts not
working with Wayland clients. This change is the first step towards working
tiling scripts in the Wayland session.
Summary:
In the context of the Touch Screen and Screen Edges KCM, using the term "Run Command" to
refer to KWin is inaccurate and misleading. By using a string that starts with an action
verb and no ellipses, it is suggested that the action is literally to run some command,
prompting the user to think "which command will it run? How do I choose what it is?"
This patch changes the action text to "Show KRunner" which is the proposed new standard.
See {T10966} for more information and reasons why to do this.
Test Plan:
{F6842531}
{F6842530}
Reviewers: #vdg, #kwin, ndavis
Reviewed By: #vdg, ndavis
Subscribers: ndavis, davidedmundson, kwin
Tags: #kwin
Maniphest Tasks: T10966
Differential Revision: https://phabricator.kde.org/D21342
Summary:
A keysym can be assigned to several keycodes, so more proper way to
determine whether given modifier is depressed is to iterate over all
returned keycodes and see if any is pressed.
If we check only the first keycode, then alternative mappings may not
work, e.g. alt key mapped to win, etc.
BUG: 407720
Reviewers: #kwin, davidedmundson
Reviewed By: #kwin, davidedmundson
Subscribers: kwin
Tags: #kwin
Differential Revision: https://phabricator.kde.org/D21302
Summary:
So far KWin didn't send axis_source, axis_discrete, and axis_stop. Even
though most of those events are optional, clients need them to work as
expected. For example, one needs axis_source and axis_stop to implement
kinetic scrolling; Xwayland needs axis_discrete to prevent multiple
scroll events when the compositor sends axis deltas greater than 10, etc.
BUG: 404152
FIXED-IN: 5.17.0
Test Plan:
* Content of a webpage in Firefox is moved by one line per each mouse
wheel "click";
* Scrolled gedit using 2 fingers on GNOME Shell, sway, and KDE Plasma;
in all three cases wayland debug looked the same (except diagonal scroll
motions).
Reviewers: #kwin, davidedmundson
Reviewed By: #kwin, davidedmundson
Subscribers: davidedmundson, kwin
Tags: #kwin
Differential Revision: https://phabricator.kde.org/D19000
Summary:
All internal clients live in the x stacking order, but when such a
client is closed, it will be moved to the normal stacking order.
Given that internal clients don't specify the desired layer, they will
be moved to the normal layer, which is not really what we want because
it means that the task switcher window will be placed below docks.
Reviewers: #kwin, davidedmundson
Reviewed By: #kwin, davidedmundson
Subscribers: kwin
Tags: #kwin
Differential Revision: https://phabricator.kde.org/D21116
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