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
Summary:
Window open/close animation effects should not animate the outline
because the end result is a bit awkward.
Reviewers: #kwin, davidedmundson
Reviewed By: #kwin, davidedmundson
Subscribers: kwin
Tags: #kwin
Differential Revision: https://phabricator.kde.org/D19886
Summary:
Currently there is no any good reason for keeping ScopedDrmPointer;
providing our own deleter for QScopedPointer would make more sense.
Given that we already have type that acts as a scoped pointer for drm
objects we can improve it a bit and make simpler, e.g.
DrmScopedPointer<drmModeConnector> connector;
is much simpler than
ScopedDrmPointer<_drmModeConnector, &drmModeFreeConnector> connector;
Reviewers: #kwin, davidedmundson
Reviewed By: #kwin, davidedmundson
Subscribers: apol, kwin
Tags: #kwin
Differential Revision: https://phabricator.kde.org/D19905
Summary:
Currently popups get positioned once at the initial configure, to set
the correct size and again when they are mapped.
Toplevels are currently only positioned when they are mapped. This works
for all cases where the the toplevel defines its own size, but not if
the window should have an initial size set by the placement strategy or
window rules. Most notably the maximised placement strategy used on
plasma mobile.
Being out of sync and resizing later currently causes a positioning bug
when plasma mobile is used with XdgShell.
This patch repositions all top levels that don't have a position set
through the plasma interface.
Test Plan: Relevant unit test
Reviewers: #kwin, bshah
Reviewed By: bshah
Subscribers: zzag, bshah, kwin
Tags: #kwin
Differential Revision: https://phabricator.kde.org/D20241
Summary:
When resizing a window particularly from the left side, we need to
co-ordinate moving the window with when we get the resized buffer.
The code in AbstractClient::handleMoveResize checks
isWaitingForResizSync to make sure we never send more than one resize
request at a time to keep that in sync.
This makes sense on X and wl_shell_surface, but not on XDGShell where we
can track which resize events have been handled by the client.
ShellClient already keeps a stack of our pending configure requests and
handles everything appropriately, we don't need to block.
This results in a smoother dragging experience and avoids a potential
deadlock currently seen when a client may not reply to a no-op configure
request.
CCBUG: 403376
Test Plan: Async ack handling is covered by existing unit tests
Reviewers: #kwin, zzag
Reviewed By: #kwin, zzag
Subscribers: zzag, kwin
Tags: #kwin
Differential Revision: https://phabricator.kde.org/D20397
Summary:
It might happen that the moving client gets closed or crashes. In that
case, we have to manually reset Workspace::movingClient, otherwise KWin
will most likely crash later on.
BUG: 405379
Reviewers: #kwin, davidedmundson
Reviewed By: #kwin, davidedmundson
Subscribers: davidedmundson, kwin
Tags: #kwin
Differential Revision: https://phabricator.kde.org/D19708
Summary:
Implementation of the Show Desktop feature moves desktop windows to
the Above layer, but it doesn't take into account existing clients
that belong to the Above layer. If there are any, we have to move
them to a layer below (e.g. normal), otherwise those clients will be
visible when showing the desktop.
BUG: 406101
Reviewers: #kwin, graesslin
Reviewed By: #kwin, graesslin
Subscribers: graesslin, kwin
Tags: #kwin
Differential Revision: https://phabricator.kde.org/D20153
Summary: Bind the keyboard shortcut {key Meta D} to {nav Show Desktop}.
Test Plan:
Apply patch, compile KWin, do `kwin --replace`, reset KWin shortcuts to default values if you've previously changed the Show Desktop's keyboard shortcut
{key Meta D} now shows and hides the desktop.
Reviewers: #kwin, zzag
Reviewed By: #kwin, zzag
Subscribers: filipf, abetts, zzag, kwin
Tags: #kwin
Differential Revision: https://phabricator.kde.org/D20066
Summary:
The NVIDIA implementation of glXSwapBuffers will, by default, queue up
to two frames for presentation before blocking. KWin's compositor,
however, assumes that calls to glXSwapBuffers will always block until
the next vblank when rendering double buffered. This assumption isn't
valid, as glXSwapBuffers is specified as being an implicit glFlush,
not an implicit glFinish, and so it isn't required to block. When this
assumption is violated, KWin's frame timing logic will
break. Specifically, there will be extraneous calls to
setCompositeTimer with a waitTime of 0 after the non-blocking buffer
swaps, dramatically reducing desktop responsiveness. To remedy this,
a call to glXWaitGL was added by Thomas Luebking after glXSwapBuffers
in 2015 (see bug 346275, commit
8bea96d701). That glXWaitGL call is
equivalent to a glFinish call in direct rendering, so it was a good
way to make glXSwapBuffers behave as though it implied a glFinish
call.
However, the NVIDIA driver will by default do a busy wait in glFinish,
for reduced latency. Therefore that change dramatically increased CPU
usage. GL_YIELD can be set to USLEEP (case insensitive) to change
the behavior and use usleep instead. When using the NVIDIA driver,
KWin will disable vsync entirely if GL_YIELD isn't set to USLEEP
(case sensitive, a bug in KWin).
However, the NVIDIA driver supports another environment variable,
__GL_MaxFramesAllowed, which can be used to control how many frames
may be queued by glXSwapBuffers. If this is set to 1 the function
will always block until retrace, in line with KWin's expectations.
This allows the now-unnecessary call to glXWaitGL to be removed along
with the logic to conditionally disable vsync, providing a better
experience on NVIDIA hardware.
Reviewers: #kwin, davidedmundson, zzag
Reviewed By: #kwin, davidedmundson, zzag
Subscribers: kwin, davidedmundson, zzag
Tags: #kwin
Differential Revision: https://phabricator.kde.org/D19867
Test Plan: I don't get the OrientationSensor SNI on my laptop, which is fine, because it was useless.
Reviewers: #kwin, #plasma, zzag
Reviewed By: #kwin, #plasma, zzag
Subscribers: kwin
Tags: #kwin
Differential Revision: https://phabricator.kde.org/D19955
Summary:
At the moment it's broken for many of the laptops I've seen, this opens the possibility to start toying with them. The right fix would be to get the kernel to emit the right signals but I'm afraid for some hardware it will be close to impossible.
This includes a kconfig variable variable that will detect it as follows: if there's a touchscreen, when the touchpad gets removed we are on tablet mode (i.e. the pointing will be done using the finger), when it's connected back tablet mode will be restored.
Reviewers: #kwin, #plasma, davidedmundson
Reviewed By: #kwin, #plasma, davidedmundson
Subscribers: mart, davidedmundson, kwin
Tags: #kwin
Differential Revision: https://phabricator.kde.org/D19604
Summary:
Otherwise it thinks outputs couldn't be created and it leaves.
Problem is that after this fix it crashes when it actually does things with:
kwin_wayland: /home/apol/devel/frameworks/kwin/composite.cpp:646: void KWin::Compositor::aboutToSwapBuffers(): Assertion `!m_bufferSwapPending' failed.
Test Plan: As said, it proceeds correctly and crashes elsewhere
Reviewers: #kwin, davidedmundson
Reviewed By: #kwin, davidedmundson
Subscribers: davidedmundson, kwin
Tags: #kwin
Differential Revision: https://phabricator.kde.org/D19921
Summary:
The NVIDIA implementation of glXSwapBuffers will, by default, queue up
to two frames for presentation before blocking. KWin's compositor,
however, assumes that calls to glXSwapBuffers will always block until
the next vblank when rendering double buffered. This assumption isn't
valid, as glXSwapBuffers is specified as being an implicit glFlush,
not an implicit glFinish, and so it isn't required to block. When this
assumption is violated, KWin's frame timing logic will
break. Specifically, there will be extraneous calls to
setCompositeTimer with a waitTime of 0 after the non-blocking buffer
swaps, dramatically reducing desktop responsiveness. To remedy this,
a call to glXWaitGL was added by Thomas Luebking after glXSwapBuffers
in 2015 (see bug 346275, commit
8bea96d701). That glXWaitGL call is
equivalent to a glFinish call in direct rendering, so it was a good
way to make glXSwapBuffers behave as though it implied a glFinish
call.
However, the NVIDIA driver will by default do a busy wait in glFinish,
for reduced latency. Therefore that change dramatically increased CPU
usage. GL_YIELD can be set to USLEEP (case insensitive) to change
the behavior and use usleep instead. When using the NVIDIA driver,
KWin will disable vsync entirely if GL_YIELD isn't set to USLEEP
(case sensitive, a bug in KWin).
However, the NVIDIA driver supports another environment variable,
__GL_MaxFramesAllowed, which can be used to control how many frames
may be queued by glXSwapBuffers. If this is set to 1 the function
will always block until retrace, in line with KWin's expectations.
This allows the now-unnecessary call to glXWaitGL to be removed along
with the logic to conditionally disable vsync, providing a better
experience on NVIDIA hardware.
Reviewers: #kwin, davidedmundson, zzag
Reviewed By: #kwin, davidedmundson, zzag
Subscribers: kwin, davidedmundson, zzag
Tags: #kwin
Differential Revision: https://phabricator.kde.org/D19867
Summary: those windows should always take all the space no matter what
Test Plan: text areas on desktop or fullscreen windows don't cause resizes anymore
Reviewers: #kwin, davidedmundson
Reviewed By: #kwin, davidedmundson
Subscribers: kwin
Tags: #kwin
Differential Revision: https://phabricator.kde.org/D19922
Summary:
This patch rewrites large parts of the Wayland platform plugin, in order to
facilitate the testing of multi output behavior in nested KWin sessions.
For that a new class WaylandOutput is introduced, which is based on
AbstractOutput and by that shares functionality with our virtual and DRM
platform plugins.
The EGL/GBM and QPainter backends have been remodelled after the DRM one,
sharing similiarities there as well now.
Pointer grabbing has been rewritten to support multiple outputs, now using
pointer locking instead of confining and drawing in this case onto a sub-
surface, which get dynamically recreated in between the different output
surfaces while the cursor is being moved.
Window resizing is possible if host supports xdg-shell, but currently the
mode size does not yet fill the new window size.
The number of outputs can be set by command line argument `--output-count`,
scaling is also supported by setting the argument `--scale`.
Further steps could be:
* Enabling automatic fill of resized windows via Wayland mode change
* Multiple diverging initial sizes and scale factors for mulitple outputs
**Watch it in action:** https://youtu.be/FYItn1jvkbI
Test Plan: Tested it in live session.
Reviewers: #kwin, davidedmundson
Reviewed By: #kwin, davidedmundson
Subscribers: davidedmundson, zzag, kwin
Tags: #kwin
Differential Revision: https://phabricator.kde.org/D18465
Summary:
alternative approach: try to resize the winidow to make room for the keyboard.
the new input wayland protocol doesn't have anymore the overlap rectangle (and it would not be going to work with qwidget apps anyways)
in the future will probably be needed anextension to the input protocol v3 which partially gets back this, tough window resizing is needed regardless
what's missing: the resize should be "temporary" and the window should be restored to its previous geometry when the keyboard closes
Test Plan: tested with test QML code
Reviewers: #plasma, #kwin, bshah, graesslin, romangg, davidedmundson
Reviewed By: #plasma, #kwin, romangg, davidedmundson
Subscribers: nicolasfella, mart, kwin, davidedmundson, graesslin
Tags: #kwin
Maniphest Tasks: T9815
Differential Revision: https://phabricator.kde.org/D18818
Summary:
Allow the user to see if rotation lock is enabled by reading the text.
Alternatively one has to hover it and wait for the tooltip.
Reviewers: #plasma, #kwin, ngraham
Reviewed By: ngraham
Subscribers: ngraham, arvidhansson, bruns, niccolove, ndavis, zzag, kwin
Tags: #kwin
Differential Revision: https://phabricator.kde.org/D19690
Summary:
This way we can see from the system tray its state.
CCBUG: 405397
Reviewers: #plasma, #vdg, ngraham
Reviewed By: #vdg, ngraham
Subscribers: ngraham, kwin
Tags: #kwin
Differential Revision: https://phabricator.kde.org/D19898
Summary:
If hardware cursor support is not available when using the drm backend for
Wayland compositing, the software cursor texture will not be updated when the
cursor image changes, and it will still be drawn when no cursor image is set
(such as when running a full-screen game). Furthermore, the drmModeSetCursor
and drmModeMoveCursor functions will still be unnecessarily called when the
cursor is moved or hidden.
To correct this, SceneOpenGL should connect Platform::cursorChanged as opposed
to Cursor::cursorChanged to its texture update function, as only the former
will be emitted when the cursor is updated and the compositor should check if
the cursor is hidden and the software cursor image is not null before rendering
it. DrmBackend::moveCursor and DrmBackend::hideCursor should also return
immediately if using a software cursor.
Reviewers: #kwin, davidedmundson
Reviewed By: #kwin, davidedmundson
Subscribers: kwin
Tags: #kwin
Differential Revision: https://phabricator.kde.org/D18376
Summary:
EffectWindow no longer looks up properties from Toplevel derived
classes, thus we can get rid of Deleted's properties. It's safe to do
because Deleted is not exposed to scripting API and those properties
were used only by effects.
Reviewers: #kwin, davidedmundson
Reviewed By: #kwin, davidedmundson
Subscribers: kwin
Tags: #kwin
Differential Revision: https://phabricator.kde.org/D19722
Summary: Like we do on inverted mode
Test Plan: Not much, because we don't support portrait mode on intel hardware just yet. I can see the cursor properly rotated before drm tells us to fall back to the previous configuration.
Reviewers: #kwin, #plasma, graesslin
Reviewed By: #kwin, #plasma, graesslin
Subscribers: zzag, kwin
Tags: #kwin
Differential Revision: https://phabricator.kde.org/D19710
Summary:
EffectsModel has to communicate with KWin in order to receive the
actual value of SupportedRole. So, in theory the model should notify
about loaded effects after receiving response from KWin, but that's
not the case.
Test Plan: Desktop Effects KCM no longer flashes when resetting changes.
Reviewers: #kwin, davidedmundson
Reviewed By: #kwin, davidedmundson
Subscribers: kwin
Tags: #kwin
Differential Revision: https://phabricator.kde.org/D18728