Prefer replacing then deleting the selection to the other way around.
This way less events need to be reported and the clipboard manager
doesn't get confused.
(cherry picked from commit 4150c1f047)
At the moment there was a race condition when putting something into the
keyboard from XWayland apps. The clipboard manager would announce a new
thing before we'd submitted it all resulting in a broken state.
This change detects when it's fetching and will only refresh the source
after everything has been sent.
BUG: 424754
CCBUG: 412350
(cherry picked from commit d335070b80)
As things are right now, we can only do 32bit textures for dmabuf (see
gbm_bo_format in gbm.h). This means that we were lying to our receivers
when we had 24bit textures by then giving a 32bit texture instead.
This changes it so we request a dummy texture before starting and if we
are offered one we assume they're available and offer a 32bits stream
directly (i.e. BGRA).
(cherry picked from commit cea2781318)
The buffer offset for client-side decorated windows is not 0, this plus
mixing the frame position and the client size may result in clipped
thumbnails of client-side decorated applications, such as gedit, etc.
BUG: 428595
(cherry picked from commit e298caaa7a)
Make sure we stay within our bounds.
Also initialise the background to transparent so there's no data from
past renders.
(cherry picked from commit 07c994fb82)
if the dock is on the top,and the dock is not close together with screen edge.
for example,the dock is 10 pixels taller then sceen edge,the "position" will be "Bottom".
Autually,the dock is on the top of screen.
(cherry picked from commit 44b2a3f872)
The property was only being updated on changes, but reset back
to `Normal` on KCM loading or after clicking Apply.
(cherry picked from commit 871611e9ec)
Listen to logind for resume notification and turn the outputs on when it
happens, much like we do when pressing a key.
This way laptops come back on when the lid opens.
BUG: 428424
(cherry picked from commit 69eb8789ba)
Once the main surface has been unmapped, we are no longer interested in
any changes that indicate that the window quads cache should be discarded
This also fixes a bug where the scene holds a subsurface monitor object
even after the associated window has been destroyed.
(cherry picked from commit 47ea0c98b1)
We want to multiply the width/height by scale weather or not we are
using GLES or not, otherwise this will only provide part of screen when
used with e.g fullscreen screenshot.
(cherry picked from commit 5e6c81eea0)
By default, the rules list moves to the hightlighted item
(the one being edited) with a constant velocity. This can
be too slow when the list contains hundreds of items.
By setting `highlightMoveDuration` we set a maximum limit
for this animation.
BUG: 428139
(cherry picked from commit cfeca03e48)
The sliding popups effect schedules a repaint and then unreferences the
deleted window. The problem with doing so is that the scheduled repaint
will be effectively discarded because the Deleted will be destroyed once
we are back in the event loop.
This issue is most noticeable on Wayland. Not sure why. If you close
Kickoff, you may see its flickering ghost in background.
If it happens that a Deleted has a pending repaint, transform it into a
workspace repaint to avoid discarding any scheduled repaints.
(cherry picked from commit 2715cbc86c)
If an output is rotated, we will compute a transform matrix for the
cursor plane to rotate its contents.
In order to compute that matrix we need the rect of the cursor in the
device-independent pixels, the scale factor and the output transform.
The problem is that we provide a rect of the cursor in the native
pixels. This may result in the cursor being partially or fully clipped.
CCBUG: 424589
(cherry picked from commit c8eeefbd7d)
If you play some video and the software cursor doesn't hover it, then
the shadow cast by the cursor will be getting darker and darker with
every frame.
The main reason for that is that kwin paints the software cursor even
if the rect behind it hasn't been damaged or repainted.
(cherry picked from commit 4a0128cac1)
If a cursor animation is driven purely by frame callbacks and kwin
uses hardware cursors, the cpu usage may spike to 100%.
This change addresses that issue by sending frame callbacks after a
compositing cycle has been performed.
(cherry picked from commit 9b09f0399f)
This was limited by the range of the edition spinbox, not by the
rules mechanism which already allowed it.
BUG: 428083
(cherry picked from commit 3d80665c0a)
GLTexture::width() and GLTexture::height() return the size of the cursor
texture in native pixels, but we need a size in device independent pixels.
CCBUG: 424589
(cherry picked from commit 6b940c1280)
QImage::rect() returns a rect in the native pixels, however we need a
rect that is in the device independent pixels.
CCBUG: 424589
(cherry picked from commit 64b7cc3cf3)
Currently, in order to use the EGLStreams backend, you need to set a
kernel parameter and an environment variable. If you set only the kernel
parameter, performance-wise, kwin will be unusable.
This change makes using the EGLStreams backend easier by making the env
var optional. If you omit KWIN_DRM_USE_EGL_STREAMS=1, kwin will check the
driver name to determine whether the EGLStreams can be enabled.
On Wayland, internal windows that use OpenGL are rendered into fbos,
which are later handed over to kwin. In order to achieve that, our QPA
creates OpenGL contexts that share resources with the scene's context.
The problems start when compositing has been restarted. If user changes
any compositing settings, the underlying render backend will be
reinitialized and with it, the scene's context will be destroyed. Thus,
we no longer can accept framebuffer objects from internal windows.
This change addresses the framebuffer object sharing problem by adding
a so called global share context. It persists throughout the lifetime of
kwin. It can never be made current. The scene context and all contexts
created in our QPA share resources with it.
Therefore we can destroy the scene OpenGL context without affecting
OpenGL contexts owned by internal windows, e.g. the outline visual or
tabbox.
It's worth noting that Qt provides a way to create a global share
context. But for our purposes it's not suitable since the share
context must be known when QGuiApplication attempts to instantiate a
QOpenGLContext object. At that moment, the backend is not initialized
and thus the EGLDisplay is not available yet.
BUG: 415798
(cherry picked from commit 292335beac)
If the surfaceless context extension is unsupported by the underlying
platform, the QPA will use the EGLSurface of the first output to make
OpenGL contexts current.
If an internal window attempts to make an OpenGL context current while
compositing is being restarted, for example it's typically the case with
the composited outline visual, QPA will either try to make the context
current with a no longer valid EGLSurface for the first output or will
crash during the call to Platform::supportsSurfacelessContext(). The
latter needs more explanation. After the compositingToggled() signal has
been emitted, there is no scene and supportsSurfacelessContext() doesn't
handle this case.
In either case, we could return EGL_NO_SURFACE if compositing is being
restarted, but if the underlying platform doesn't support the surfaceless
context extension, then the composited outline will not be able to
delete used textures, framebuffer objects, etc.
This change addresses that problem by making sure that every platform
window has a pbuffer allocated in case the surfaceless context extension
is unsupported.
(cherry picked from commit cc8cb8db9d)
Platform::supportsQpaContext() indicates if the EGL display supports
surfaceless contexts, so reflect that in the method name.
(cherry picked from commit 29fbe27ffc)
This makes our QPlatformOpenGLContext private subclass simpler.
As a slightly unrelated change, this patch also fixes a bug where our
platform opengl context may return a wrong surface format if surfaceless
contexts are unsupported.
(cherry picked from commit 9b89a3d967)
Every time Platform::supportsQpaContext() is called, we go through the
list of supported extensions and perform a string comparison op. This is
not really cheap.
(cherry picked from commit b7bd8472f2)
Currently, flip output transformations in the software fallback code
path are equivalent to normal rotate output transformations.
This change implements flip output transformations according to the
wl_output spec.
Currently, when the DRM platform uses cursor planes, the cursor on
a rotated output may be cropped because the math behind the current
cursor transform matrix is off.
In order to fix the cropping issue, this change replaces the current
cursor transform matrix with the core part of the surface-to-buffer
matrix, which was written against the wl_output spec.
BUG: 427605
CCBUG: 427060
Currently, Qt clients send two maximize requests separated by the
initial commit. From spec's perspective, this is totally fine, the
client should receive two configure events with "maximized" state.
But because changeMaximize() in XdgToplevelClient and setMaximized()
operate on two different maximize modes, the second maximize request
will trick kwin into thinking that the client should be restored.
(cherry picked from commit a195223a8d)
If Xwayland has crashed, the Workspace will block stacking order updates
and start destroying all X11 clients.
Once stacking order updates are unblocked, the Workspace will mark the X
stacking order as dirty and create a new Xcb::Tree object.
We don't want to create that Xcb::Tree object because accessing it
after the XCB connection has been shut down will lead to a crash.
BUG: 427688
FIXED-IN: 5.20.1
(cherry picked from commit 2093820aba)
Placement::placeTransient() checks the frame geometry right after
setting it. That is a problem because geometry updates for
XdgPopupClient are made in async fashion. We need to block geometry
updates in order to ensure that window placement code sees correct
geometry.
(cherry picked from commit f369a3557c)