Commit graph

19805 commits

Author SHA1 Message Date
Vlad Zahorodnii
a1c6e2584a x11: Re-use Qt's EGLDisplay
This is to ensure that both kwin and Qt use the same EGLDisplay. Note
that the native context handle can have no display, however it's very
unlikely to happen.
2021-07-05 09:14:09 +00:00
Vlad Zahorodnii
9f6b5ea44f x11: Call eglGetPlatformDisplayEXT() without attrs
There are EGL implementations that will refuse to create a context if
the share context belongs to other EGLDisplay. Currently, that's the
case on some platforms.

If eglGetPlatformDisplayEXT() is called with the same parameters, it'll
return the same EGLDisplay. The main motivation behind this change is to
ensure that both kwin and Qt share the same EGLDisplay, QtXCB calls
eglGetPlatformDisplayEXT() without any additional args.

If EGL_PLATFORM_X11_SCREEN_EXT is not specified via attrs, the EGL
implementation will use the default screen, which is the same as
m_x11ScreenNumber.
2021-07-05 09:14:09 +00:00
Vlad Zahorodnii
12b14779ba x11: Gracefully handle failed compositing initialization
X11Platform includes NoCompositing in supported compositing types.
Therefore, Q_UNREACHABLE() cannot be used.
2021-07-05 11:53:26 +03:00
Vlad Zahorodnii
8b8669eece scene: Avoid discard quads when only position changes
Since the quads are in the item local coordinate space now, it is okay
not to discard cached quads if only the item position changes.
2021-07-04 16:12:33 +00:00
Vlad Zahorodnii
c6ffdf4f7f kwineffects: Remove WindowQuad::uvAxisSwapped
Since makeSubQuad() uses bilinear interpolation, the flag to indicate
whether UV-coordinates are swapped is redundant.
2021-07-04 16:12:06 +00:00
Aleix Pol
8386a8bb66 tablet+libinput: do not crash if there's a tablet event without a client
It triggers if you start with your pen on the tablet while starting
kwin.
2021-07-02 23:50:57 +02:00
Aleix Pol
c8a37ef27f tablet: use the right scope for the variable 2021-07-02 20:54:57 +02:00
Aleix Pol
df9978d6a1 tablet: no need to forward the cursorChanged signal
It's already emitted by updateCursor, so we were doing it twice.
2021-07-02 20:54:45 +02:00
Xaver Hugl
f54d7a2697 xdgshellclient: fix moveresize with touch and CSD
When moveresize is done with touch we need to use the current touch
point and not the mouse position.

BUG: 438283
CCBUG: 431489
2021-07-01 13:13:07 +00:00
Xaver Hugl
a4dcfbfb31 input: fix touch input getting borked on quick tile
The decorationPressId never gets reset as the decoration isn't below the
touch point anymore after the quick tile, so if we have no decoration
under the touch point reset the decorationPressId to -1.

CCBUG: 430560
2021-07-01 13:11:41 +00:00
David Edmundson
893f95eed8 Guard against null compositor in thumbnail item
If compositing is disabled, compositor will be null.

We hit a path where we could destroyOffscreenTexture when the
compositing is disabled then again when the Thumbnail is destroyed. In
this case we query Compositor::self()->scene() and crash.
2021-07-01 12:38:57 +01:00
l10n daemon script
f53cf9d71e 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"
2021-06-30 01:21:12 +00:00
David Redondo
b4150e3eb5 Fix build 2021-06-29 10:32:06 +02:00
Xaver Hugl
2ecce63d93 platforms/drm: don't crash if drmModeGetConnector fails
I don't think this is the cause of 439208, where it's likely only a
side effect of some other issue; should be guarded against anyways.

CCBUG: 439208
2021-06-28 20:13:36 +00:00
Laurent Montel
ee4c9cd6d5 Fix compile with last ecm
(With
https://invent.kde.org/frameworks/extra-cmake-modules/-/merge_requests/145
we have disabled the C and C++ specific compiler extensions)
2021-06-28 08:03:12 +02:00
l10n daemon script
a333b87f74 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"
2021-06-28 01:30:05 +00:00
Xaver Hugl
6260c03548 platforms/drm: don't create modeset dumb buffer for import gpu
When the EglStreamBackend is used for the secondary GPU we don't need
the modesetting dumb buffer.
2021-06-25 10:08:36 +00:00
Emilio Cobos Álvarez
14b70e5e77 wayland: Set cursor surface outputs. 2021-06-25 08:58:28 +00:00
Xaver Hugl
7e96f09670 platforms/drm: use correct size for soft rotation 2021-06-25 00:46:32 +02:00
Vlad Zahorodnii
3427143017 Improve thumbnail item integration
Currently, thumbnail items are rendered by kwin. This means that qtquick
code cannot do things such as applying shader effects to window thumbnails
or simply draw custom controls on top of thumbnails.

With this change, task switchers and qml extensions will be able to
place their own contents on top of thumbnails and apply custom effects
to them.

In order to integrate window thumbnails, a window is rendered on kwin
side using its own opengl context. A fence is inserted in the command
stream to ensure that the qtquick machinery doesn't start using the
offscreen texture while there are still rendering commands being executed.

Thumbnails are rendered into offscreen textures as we don't have full
control over when qtquick windows render their contents and to work around
the fact that things such as VAOs can't be shared across OpenGL contexts.

WindowThumbnailItem and DesktopThumbnailItem act as texture providers.
2021-06-23 17:46:05 +03:00
Vlad Zahorodnii
172c541cad x11: Use global share context
This is needed to share window thumbnails between kwin's scene graph and
qtquick.
2021-06-23 17:45:48 +03:00
Vlad Zahorodnii
8ed364337b scenes/opengl: Allow setting external global share context
This is needed to initialize global share context on X11.
2021-06-23 17:45:48 +03:00
Vlad Zahorodnii
fac33750f9 effects: Remove shape property
It's unused and the advantages of keeping it are outweighed by the
disadvantages - the returned value is dependant on the window type.

If you need to draw a drop-shadow that matches the shape of the window
or something along that line, render the window into an offscreen
texture and sample the alpha channel in a fragment shader.
2021-06-23 11:21:51 +00:00
Xaver Hugl
80a7362efc platforms/drm: refactor post processing bits
Putting the OpenGL post processing rotation into its own class cleans
the EglGbmBackend code up a bit and adds post processing rotation for
the EglStreamBackend
2021-06-22 16:35:42 +00:00
Vlad Zahorodnii
b482226d6c wayland: Implement activities window rule
BUG: 439022
2021-06-22 13:48:05 +00:00
Vlad Zahorodnii
0e9ab1fced autotests: Fix TestBuiltInEffectLoader
The looking glass effect creates an opengl texture at load time without
a current context, which aborts the test.

The test should be converted into an integration test. Mocking the GL
library is simply not feasible and not worth the trouble. :/
2021-06-22 16:40:11 +03:00
Vlad Zahorodnii
5d1062f42d autotests: Fix VirtualKeyboardDBusTest
Input method is enabled by default now, adjust the test to that.
2021-06-22 16:28:45 +03:00
Vlad Zahorodnii
4206d8bd9c Remove unused include 2021-06-22 11:45:44 +03:00
Vlad Zahorodnii
da169ee2d9 Replace QRegExp usages with QRegularExpression
QRegExp is deprecated in favor QRegularExpression. It's potentially an
api breaking change as QRegularExpression has a different pattern syntax.
2021-06-22 08:35:10 +00:00
Vlad Zahorodnii
c61085dc2e Remove Toplevel::compositing() and Workspace::compositing()
It is error-prone to have multiple sources for the same data. If the
base implementation (Compositor::compositing()) changes, other helpers
can get out of sync.
2021-06-22 08:32:35 +00:00
Vlad Zahorodnii
ae70b17c79 Set compositor On status before setupCompositing()
This is needed to ensure that Compositor::compositing() returns true
when Toplevel::setupCompositing() is called.
2021-06-22 08:32:35 +00:00
Vlad Zahorodnii
d74e81bdd0 x11: Properly detect compositing status
When finishing compositing, Workspace::compositing() will return true,
but it will be preferred if it returns false instead so kwin can properly
update x11 window visibility status, etc.

Instead of checking whether the compositor has a scene, check the status
of the compositor. It will not be "On" during teardown.
2021-06-22 08:32:35 +00:00
Vlad Zahorodnii
10769548db kwineffects: Allow creating GLTexture without allocated storage
This allows creating a GLTexture object and attaching a dmabuf to it.
Currently, we can do that by using the foreign GLTexture constructor,
but it makes the deletion of the texture handle more error prone.

In the future, we can add a method that allocates the texture storage,
but there's no need for that yet.
2021-06-22 08:25:50 +00:00
Vlad Zahorodnii
2b8453abb8 platforms/x11: Port away from GLTexture::discard()
Currently, if discard() is called, kwin will crash because
EglPixmapTexture does not override the discard method.

In principle, neither GlxPixmapTexture nor EglPixmapTexture should mess
around with internals of the GLTexture class. It is better to have a
wrapper texture with a bind method, which will re-bind the pixmap to the
opengl texture if necessary.
2021-06-22 08:25:50 +00:00
Vlad Zahorodnii
3b8b87a663 scenes/opengl: Update unstyled EffectFrame texture only when rendering
When the EffectFrame is created, there may not be any opengl context
current.
2021-06-22 09:58:31 +03:00
Vlad Zahorodnii
19699e9a26 scene: Store cached quads using std::optional
This way, the code is slightly more readable.
2021-06-21 16:32:55 +00:00
Xaver Hugl
9194c0c974 platforms/drm: some improvements for logging 2021-06-21 17:57:36 +02:00
Xaver Hugl
7552b53066 partially revert 2742e5b422
It seems like without a surface creation of the scene fails somehow. At
least until the exact problem is solved, update outputs for EglStream
gpus before creating the EglStreamBackend.

BUG: 438363
2021-06-21 14:49:44 +02:00
Xaver Hugl
0f6495f4b2 XdgSurfaceClient: set to current activity and desktop in constructors
BUG: 435745
FIXED-IN: 5.22.2
2021-06-20 20:37:29 +02:00
Xaver Hugl
0223136712 platforms/drm: fix mistake in DrmGbmBuffer
When gbm_bo_get_handle_for_plane isn't supported or doesn't work we'd be
passing the buffer format as its handle to drmModeAddFB(2).
2021-06-20 18:47:10 +02:00
Vlad Zahorodnii
46b81be246 autotests: Make SceneQPainterTest more robust to BufferInterface changes
At the moment, the test depends on the implicit client connection flush
in BufferInterface::unref(). It will be highly desirable if that connection
flush is gone as it allows us batching wayland events better. It also
allows us remove a system call from a hot path.
2021-06-19 09:24:16 +00:00
Alexander Lohnau
e170c3be7d
Use K_PLUGIN_CLASS_WITH_JSON instead of K_EXPORT_KPACKAGE_PACKAGE_WITH_JSON
Task: https://phabricator.kde.org/T14542
2021-06-19 07:12:52 +02:00
Vlad Zahorodnii
b494efb23e autotests: Fix kwinglplatformtest
OpenGL2Compositing enum was replaced with OpenGLCompositing.
2021-06-18 17:31:32 +03:00
Xaver Hugl
b33fef02f5 platforms/drm: show cursor when exiting dpms
BUG: 438824
2021-06-18 14:10:22 +00:00
Nate Graham
c9a719e109 [effects] Use standard arrow cursor in Present Windows & Desktop Grid
The pointing finger cursor is used to show that a piece of text is a
clickable link, and it is inappropriate to use it in other contexts.
Regular UI elements that do something when single-clicked continue to
use the standard arrow cursor in other contexts, so let's follow that
convention in the Present Windows and Desktop Grid effects too.

BUG: 421928
FIXED-IN: 5.23
2021-06-18 12:58:40 +00:00
Felipe Kinoshita
ca3609eb4d [kcmkwin/kwincompositiong] Remove not so useful separators lines
This commit removes the separators lines below "scale method" and
"rendering backend", options here shouldn't be separated since they
are all related to eachother.
2021-06-18 10:40:23 +00:00
Nate Graham
bbf9c54dd8 [kcmkwin/kwineffects] Collapse list item when clicking on it again
Currently, each effect's list items expands when you click on any
non-interactive part of it, but it does not collapse when you click on
it again.

With this commit, now it does.

BUG: 421883
FIXED-IN: 5.23
2021-06-18 10:17:47 +00:00
Aleix Pol
56915dc113 xdgactivation: do not tell effects about unknown applications
Makes for an odd decoration.
We generally will not have an app_id in the cases where we are creating
a token just in case it's necessary down the line.
2021-06-18 00:11:56 +00:00
Aleix Pol
81f7436fda xdgactivation: Let activation requests through when they come from a window manager
If a client already has powers to move clients around, let them also
activate using the right protocols as well.

This is useful to be able to implement SNI or Notifications where the
shell doesn't get full surface activation when interacting with it.
2021-06-18 00:11:56 +00:00
Nicolás Alvarez
08143fb0d0 Update IRC network name in the README
KDE has moved from freenode to Libera Chat, update the README to reflect
this.
2021-06-17 10:07:23 +03:00