Commit Graph

18476 Commits (a9624fc0caaa45bd867e01fcecdff81666d285f2)

Author SHA1 Message Date
Jonathan Riddell a9624fc0ca Update version number for 5.20.4
GIT_SILENT
2020-12-01 11:04:40 +00:00
Aleix Pol 10e1b6fd9d xwl: No need to delete the source immediately
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)
2020-11-28 15:34:16 -07:00
Aleix Pol 7bfb9add96 xwl: No need to create createX11Source twice consecutively
(cherry picked from commit 0549c14588)
2020-11-28 15:34:08 -07:00
Aleix Pol 99b29195b4 xwl: Do not refresh the x11 Clipboard while fetching
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)
2020-11-28 15:33:51 -07:00
Aleix Pol 9854f40333 xwl: Include errors and warnings
(cherry picked from commit 439dcc4b1f)
2020-11-28 15:32:27 -07:00
Aleix Pol a3f5d43100 screencating: query for dmabuf availability before we start streaming
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)
2020-11-27 15:57:39 +00:00
Vlad Zahorodnii 038aa9d8d7 wayland: Fix clipped thumbnails of client-side decorated apps
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)
2020-11-27 15:35:52 +00:00
Michał Ziąbkowski 6acab64718 Fixed Toggle Night Color global shortcut, which used i18n in object name, leading to erratic behavior e.g. when system locale or translations changed.
BUG: 428024


(cherry picked from commit b186f86786)
2020-11-24 18:27:31 +00:00
Xaver Hugl 4361892c25 Set setMoveResize(true) after stopping fullscreen and quick tiling
BUG: 427848


(cherry picked from commit 459aa66d8e)
2020-11-24 18:18:47 +00:00
Aleix Pol 233df87c2c screencasting: don't crash if the cursor is too big for our buffer
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)
2020-11-23 13:45:09 +00:00
xinbo wang 2a4fb12f8f fix: magiclamp effect wrong direction.
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)
2020-11-19 15:22:16 +00:00
Ismael Asensio 922dc0050b kcm/decorations: Fix border size updating for thumbnails
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)
2020-11-16 17:24:12 +00:00
Jonathan Riddell b9de46059b Update version number for 5.20.3
GIT_SILENT
2020-11-10 19:18:18 +00:00
l10n daemon script 13c59686c6 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"
2020-11-10 09:39:41 +01:00
Aleix Pol 0b5cbe4016 Restore empty filename check
Otherwise we could end up matching with a weird ".../.desktop" entry.

BUG: 427979


(cherry picked from commit a92ce693ec)
2020-11-07 03:19:13 +00:00
Aleix Pol 191bef73ac drm: Make sure the screens are turned on when we come from suspend
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)
2020-11-03 18:36:05 +00:00
Vlad Zahorodnii 405a0360fb Move some connects from Scene::addToplevel() to Window constructor
(cherry picked from commit 1694b24fa6)
2020-11-03 17:01:23 +02:00
Vlad Zahorodnii 575cc46a8a scene: Stop monitoring changes for unmapped surfaces
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)
2020-11-03 17:01:01 +02:00
Bhushan Shah 7b4925f761 effects/screenshot: fix the screenshot on GLES
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)
2020-11-03 09:29:21 +00:00
Lewis Lakerink 00570eb741 [scene] Fix segfault in KWin::WindowPixmap::shape (BUG: 426567)
(cherry picked from commit 00ce98b7a2)
2020-11-03 07:43:48 +00:00
Ismael Asensio 7465dcc9de kwinrules: Limit hightlight scrolling duration
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)
2020-11-02 16:04:15 +01:00
l10n daemon script 2ce464a15a 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"
2020-10-31 09:42:02 +01:00
Vlad Zahorodnii 3d40db866c Transform a pending repaint into a workspace repaint before destroying Deleted
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)
2020-10-29 11:54:10 +00:00
Jonathan Riddell 022cc8a661 Update version number for 5.20.2
GIT_SILENT
2020-10-27 11:47:00 +00:00
Vlad Zahorodnii ea82e10a59 Provide cursor geometry in device-independent pixels
QImage::size() returns the size of the cursor image in the native
pixels. We cannot use it as the cursor size.

(cherry picked from commit 170a0b6395)
2020-10-27 08:29:15 +02:00
Vlad Zahorodnii 44dcb6d0a5 platform/drm: Fix clipped HiDPI hardware cursors
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)
2020-10-27 08:29:00 +02:00
Vlad Zahorodnii ff4a0d9713 Clip software cursors
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)
2020-10-27 08:28:47 +02:00
Vlad Zahorodnii 838d7e7a14 Mark the cursor as rendered after performing compositing
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)
2020-10-27 08:27:39 +02:00
Ismael Asensio 9ae4021ef4 [kwinrules] Allow negative numbers in position
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)
2020-10-27 02:09:00 +00:00
Vlad Zahorodnii 6577a35ec9 screencast: Handle the case where pipewire is not installed
If pipewire is not installed, pw_loop_new() may return a nullptr.

BUG: 427949


(cherry picked from commit 4b12afced9)
2020-10-26 11:44:04 +00:00
Vlad Zahorodnii 9d2b27aebb scenes/opengl: Properly render cursors with hidpi
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)
2020-10-25 08:58:33 +00:00
Vlad Zahorodnii f123990930 wayland: Fix drag-and-drop cursors with hidpi
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)
2020-10-25 08:58:00 +00:00
Vlad Zahorodnii f6c4cc6b8d platforms/drm: Use a heuristic to determine if EGLDevice backend can be used
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.
2020-10-23 10:33:57 +03:00
Méven Car 853ce5bcb8 ScreenshotEffect: don't expect authorization for interactive screenshots 2020-10-22 12:35:40 +02:00
Vlad Zahorodnii 445d1496e4 Introduce persistent global share context
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)
2020-10-20 12:21:31 +00:00
Vlad Zahorodnii 062e0441a5 Fix a potential SIGSEGV
Compositor::self()->scene() may return nullptr while compositing is
being restarted.

(cherry picked from commit da12d3804f)
2020-10-20 12:21:31 +00:00
Vlad Zahorodnii 3dcc4ebd37 qpa: Create a pbuffer for internal windows
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)
2020-10-20 12:21:31 +00:00
Vlad Zahorodnii 259dedfc99 core: Use less confusing name for Platform::supportsQpaContext()
Platform::supportsQpaContext() indicates if the EGL display supports
surfaceless contexts, so reflect that in the method name.

(cherry picked from commit 29fbe27ffc)
2020-10-20 12:21:31 +00:00
Vlad Zahorodnii 7d327d0b8f qpa: Merge OpenGL platform context classes
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)
2020-10-20 12:21:31 +00:00
Vlad Zahorodnii 77a6d2c6fa scene: Reduce the call cost of Platform::supportsQpaContext()
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)
2020-10-20 12:21:31 +00:00
Jonathan Riddell 8edf25c1ab Update version number for 5.20.1
GIT_SILENT
2020-10-20 12:32:05 +01:00
Lewis Lakerink ae6e7feef0 Fix pipewire stream double free
(cherry picked from commit 16cb4286b1)
2020-10-20 08:11:54 +00:00
Fabian Vogt 6addcab364 Detect softpipe and llvmpipe on Mesa 20.2+
It seems like the vendor string changed from "VMware Inc." to "Mesa/X.org".
2020-10-19 16:56:25 +02:00
Vlad Zahorodnii e9b751d2c1 wayland: Introduce logicalToNativeMatrix() helper
The new helper function computes the projection matrix from the logical
coordinate space to the display coordinate space.
2020-10-16 20:06:57 +03:00
Vlad Zahorodnii 642be48bd2 platforms/drm: Fix software flip output transforms
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.
2020-10-16 20:06:45 +03:00
Vlad Zahorodnii 1fd9ae618a platforms/drm: Compute correct cursor transform matrix
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
2020-10-16 20:06:28 +03:00
Vlad Zahorodnii 76a33c90fb wayland: Fix Qt clients not being maximized initially
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)
2020-10-15 11:35:56 +00:00
Vlad Zahorodnii 0109bdbba9 xwayland: Avoid creating a tree query on crash
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)
2020-10-14 16:18:19 +00:00
Vlad Zahorodnii 83ed25031c wayland: Block geometry updates while placing popups
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)
2020-10-13 18:04:27 +00:00
Nicolas Fella e35a5a7e1d Fix KWIN_EFFECT_FACTORY macros
The macros don't work because of the mismatching capitalization.

(cherry picked from commit 968b57fe2f)
2020-10-12 22:29:48 +02:00