Commit graph

20405 commits

Author SHA1 Message Date
Vlad Zahorodnii
65e8c0c737 Simplify WaylandServer::initWorkspace()
If kscreenlocker integration is on, the initialized() signal can be
still emitted in WaylandServer::initWorkspace().
2021-10-12 06:32:55 +00:00
Vlad Zahorodnii
d941c97d8e Remove unused includes 2021-10-12 06:32:55 +00:00
l10n daemon script
16e38fe07b 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-10-12 01:19:47 +00:00
Nicolas Fella
310684f1a7 Fix build by lowering KDE_COMPILERSETTINGS_LEVEL
It doesn't build against the stricter 5.85 level
2021-10-11 21:59:39 +02:00
Jonathan Riddell
57c06d0e00 Update kf5 version requirement to 5.86
GIT_SILENT
2021-10-11 20:48:20 +01:00
Rodney Dawes
886a86ab2b Pass correct argument to Q_UNUSED for disabled features 2021-10-08 13:19:35 -04:00
Martin Flöser
68589fe937 compositor: Merge the OpenGL 2 and 3 backends
This change merges the two OpenGL backends into one making the current
default of GLCore the overall default. It becomes the first context to
try to create. If it fails, it will automatically fall back to the
(previous) OpenGL 2 backend.

Reasoning: the differentiation of OpenGL 2 and 3 is a very technical one
and hard to understand for users. It is not obvious which one is better
or should be used. This results in many user discussions like "Which
backend to use?"

Back when the OpenGL 3 backend was introduced the dedicated feature made
sense. It was a new code base using new driver features. Nowadays the
code base in KWin is robust and mature and so are the drivers. A driver
advertising support for OpenGL 3 will support OpenGL 3. We don't have to
plan for driver breakage in this area any more.

Also our code evolved through the context attribute builder which gives
us the possibility to more easily fall back in case we cannot create the
context. Thus the need to select the backend is not so important as it
used to be when the feature got introduced.

If a user still wants to force OpenGL2, it is still possible by setting
the appropriate environment variables like MESA_GL_VERSION_OVERRIDE.

This change brings the improvement that the backend selection is now
completely removed from the compositing KCM.
2021-10-08 15:26:25 +00:00
Vlad Zahorodnii
bc8c7a5fce autotests: Make testXdgShellClientRules more robust to CI being heavily loaded
FAIL!  : TestXdgShellClientRules::testSizeApply() 'surfaceConfigureRequestedSpy->wait(10)' returned FALSE. ()
   Loc: [/home/jenkins/workspace/Plasma/kwin/kf5-qt5 SUSEQt5.15/autotests/integration/xdgshellclient_rules_test.cpp(731)]

If CI is moderately loaded, 10ms may not be enough. I don't remember why
10ms timeout was added.
2021-10-07 20:17:37 +00:00
Vlad Zahorodnii
dee97068fb autotests: Stabilize testXdgShellClient
Currently, testXdgWindowReactive() is a bit flaky because the parent
window and the popup window are created together. The popup can be
configured again if its global position changes after the parent window
has been placed.

In order to stabilize the test, create the parent window, then the popup
window.
2021-10-07 23:16:41 +03:00
Vlad Zahorodnii
4ba7aa62b9 Reset WaylandServer::s_self in destructor
When using KWIN_SINGLETON macros, you still need to reset s_self
manually in the destructor.
2021-10-07 18:26:43 +03:00
Vlad Zahorodnii
5be593d4e4 wayland: Drop internal connection
It's practically unused now.
2021-10-07 13:28:08 +00:00
Benjamin Port
9c4f358a64 NightColor: use config watcher to update state when configs are changed 2021-10-07 13:12:30 +00:00
Alex Richardson
722f092b7a Fix a -Wformat warning on FreeBSD
On FreeBSD we get a long long result so %ld triggers a warning. Cast to
long long and use %lld to make it work on all platforms (including 32-bit).
2021-10-07 08:24:01 +00:00
Alex Richardson
8ab41804f0 Increase minimum KDecoration2 version
I just got a build failure because I hadn't updated KDecoration to
include 195bcf36df.
Bump the minimum version to trigger a CMake error instead of a
compilation failure. Since we expect to be using the same version of
KDecoration as KWin, this change uses ${PROJECT_VERSION} as the minimum
version.
2021-10-07 07:40:16 +00:00
Xaver Hugl
9f69d4c9c2 platforms/drm: set DPMS property properly 2021-10-07 07:02:50 +00:00
Vlad Zahorodnii
4f3ff4fbb0 wayland: Improve default placement of pointer
Currently, the pointer is moved to the center of the workspace. However,
on a multi-monitor setup, the workspace center may not be the same as
the center of the output it's on. That's the case with my setup -
1920x1080, 1920x1080, 1080x1920 (the monitors are laid out in a row from
left to right).

This change improves the default placement of the pointer by actually
moving it to the center of the screen that contains the workspace center
so the pointer doesn't end up at some "random" position from the user's
point of view.
2021-10-07 05:49:42 +00:00
Andrey Butirsky
c9b41a1682 fix wrong approach geometry of screen edge's effect
Edge geometry has width and height, so we need the correction for
approach geometry of bottom and right corners.
The other edges are fixed as well.

BUG: 442973
2021-10-06 22:57:33 +00:00
Vlad Zahorodnii
e6c77a1ddc Clear should_get_focus in Workspace::focusToNull()
On X11, there are four input models. With some input models, it's okay
if the window manager calls XSetInputFocus(), with others, the wm has to
ask the client to make a XSetInputFocus() request.

If kwin wants a client to take input focus, kwin will add the client
to the should_get_focus list, which contains all the windows that
are about to get input focus. Clients are popped from the list upon
receiving FOCUS_IN events.

A client will be added to the should_get_focus list even if kwin thinks
that the client already has input focus because communication between
the wm and xorg is async, anything can happen with input focus in meanwhile.

On the other hand, the wm may sometimes focus the null window if no
window should contain the input focus. The issue is that the
should_get_focus list is not cleaned up in that case, which can lead to
Workspace::mostRecentlyActivatedClient() returning wrong client and
possibly other async related issues.

We don't have such madness on Wayland as the compositor is in charge of
handling input focus.

This change makes Workspace::focusToNull() clear the should_get_focus,
which is reasonable. We need to deactivate "in-flight" focus requests.

This also fixes the bug where fullscreen Wayland windows don't go above
docks and panels due to Workspace::mostRecentlyActivatedClient() returning
bad client.

BUG: 439405
BUG: 395919
2021-10-05 14:53:20 +00:00
Nicolas Fella
2314867945 Add kde-ci.yml
List of deps is based on CMakeLists.txt
2021-10-05 13:11:38 +00:00
Xaver Hugl
ef894f34eb xdgshellclient: fix initial placement with maximize
BUG: 439986
2021-10-04 09:39:58 +00:00
Xaver Hugl
6a68caef7b Only emit outputDisabled if the output is enabled
CCBUG: 440322
2021-10-04 09:38:40 +00:00
Xaver Hugl
178e69b39b platforms/drm: handle hotplugs with disabled outputs better
If the last enabled output gets removed but we have disabled outputs
still connected, enable the first disabled output to prevent a crash.

BUG: 442990
2021-10-04 09:37:52 +00:00
Méven Car
85fb0e7c43 IdleTimePoller: Fix a crash at shutdown
Currently, kwin crashes at shutdown because the idle poller plugin is unloaded when exit handlers are run, after the waylandServer() is destroyed. This results in null dereferencing.

BUG: 443268
2021-10-04 10:24:23 +02:00
Vlad Zahorodnii
8ac93a59ff scene: Handle Xwayland windows changing surfaces
Xwayland can re-create the wl_surface if the window has been previously
unmapped.

BUG: 442936
BUG: 426069
2021-10-04 05:56:27 +00:00
Vlad Zahorodnii
73162e8fae Store Toplevel surface using QPointer
This makes Toplevel::setSurface() simpler.
2021-10-04 05:56:27 +00:00
Vlad Zahorodnii
52c9dbb487 wayland: Reset Toplevel::surfaceId after surface is created
Xwayland will re-create the wl_surface object if the X11 window is
unmapped and mapped. That, and the fact that the order in which the
WL_SURFACE_ID client message event is received and the wl_surface object
is created is undefined can cause the following bug:

* WL_SURFACE_ID is received
* the old wl_surface object is destroyed, m_surfaceId is reset to 0
* new wl_surface is created but because m_surfaceId is 0, it won't be
  associated with the x11 window

This change ensures that kwin will associate the wl_surface with x11
window by making it not reset cached surface id when the old wl_surface
is destroyed.

However, we cannot leave m_surfaceId as is because wayland aggressively
re-uses object ids so kwin can associate wrong surface with x11 window.

To prevent that, this change also makes Toplevel::setSurface() reset
cached surface id.

CCBUG: 442936
CCBUG: 426069
2021-10-04 05:56:27 +00:00
Vlad Zahorodnii
61eb8ce75b Fix double close()
AbstractDataSource::requestData() takes the ownership of the file
descriptor. So the second close() will close an already closed fd.
2021-10-04 05:41:23 +00:00
Xaver Hugl
d83da1cdac platforms/drm: remove redundant check for placeholder output
It's not necessary, the placeholder output already gets created in DrmBackend::removeOutput
if necessary. More improtantly it's missing the check for shutdown, which
may cause issues if the computer is turned off while no outputs are connected.
2021-10-03 16:33:01 +02:00
Méven Car
8c908c69bc Port src/plugins/idletime/poller.cpp away from the internal connection 2021-10-01 15:01:23 +00:00
Kristen McWilliam
cc06f62749 Fix center snap zone to account for available space 2021-10-01 14:55:12 +00:00
Xaver Hugl
d55011ae86 platforms/drm: handle disabled outputs better
BUG: 442603
2021-10-01 08:53:10 +00:00
Vlad Zahorodnii
6b313268dd Allow passing -1 screenId to Workspace::clientArea() again
Allow passing -1 screen id to clientArea() until the effects are ported
to EffectScreen.
2021-10-01 08:07:51 +00:00
Vlad Zahorodnii
21da7b7ed8 effects/thumbnailaside: Fix crash in clientArea()
clientArea() was changed to forbid "-1" screen ids, but it seems like
the thumbnail aside effect can pass it to refer to the active screen.

This change makes the thumbnail aside effect handle "-1" screen id case
explicitly. It will be also useful for EffectScreen transition.

BUG: 443166
2021-10-01 08:07:51 +00:00
Xaver Hugl
eeb1bd5b38 Fix a few clazy warnings 2021-09-30 12:26:25 +00:00
Vlad Zahorodnii
721bfe1740 autotests: Fix TestDBusInterface
x11DesktopNumber property was replaced with the desktops property, which
is a list of desktop ids.
2021-09-30 10:29:06 +03:00
Xaver Hugl
bcbba62c7c platforms/drm: remove dangling pointer of lease outputs pipeline 2021-09-30 07:16:49 +00:00
Vlad Zahorodnii
66badd905b kcmkwin/rules: Fix suggested values for virtual desktops rule
If the virtual desktops rule is created, only the last virtual desktop
the window is on is going to be checked.

With this, all virtual desktops that the window is currently on will be
checked.

Technically, it's an api breaking change, but the window rules kcm is
the primary user of queryWindowInfo() so I don't think it's a big deal.
2021-09-30 05:40:04 +00:00
Vlad Zahorodnii
57a8d5ca50 autotests: Port testQuickTiling to AbstractOutput 2021-09-29 14:00:45 +00:00
Vlad Zahorodnii
31b9f34d9b libinput: Port to AbstractOutput
CCBUG: 443088
2021-09-29 12:03:39 +03:00
Alexander Lohnau
1022ce0036 Fix condition for making themes configurable
KPluginMetaData::findPlugins only returns valid json metdata, the previous
check was accidentally kept for the condition that the plugin provides a theme engine.

BUG: 442978
FIXED-IN: master
2021-09-28 23:08:43 +00:00
Xaver Hugl
6ca530e02b platforms/drm: fix small memory leak 2021-09-28 23:48:36 +02:00
Vlad Zahorodnii
6bbda88ab5 platforms/drm: Avoid making real commits while searching for output config
This change limits the brute force output configuration search routine
to test only commits, it's way more efficient than real commits.

CCBUG: 442603
2021-09-28 11:31:54 -06:00
Vlad Zahorodnii
eb1daa0aad platforms/drm: Avoid re-using blobs
Blobs are not reference counted if used by other drm master, if kwin
re-uses a deleted blob in an atomic commit, it will fail. For example,
on my computer, this happens when kwin starts after xorg.

Besides that, kwin may try to destroy blobs that it doesn't own, which
is not fatal but it's strange to do so.

CCBUG: 442603
CCBUG: 439873
2021-09-28 11:31:54 -06:00
Vlad Zahorodnii
6513c66ca6 wayland: Move ConnectionAdaptor to the same thread as Connection
Connection deletes the ConnectionAdaptor, but they are in different
threads, which is weird.

CCBUG: 442104
2021-09-28 17:29:34 +00:00
Aleix Pol
6cf060223e gbm: Do not create buffers when there is no display 2021-09-28 17:18:34 +00:00
Aleix Pol
9bda050d84 screencasting: Do not crash when the platform cannot provide textures
When using the QPainter backend, we will be getting null textures. Just
ignore these as the backend isn't all that important.

BUG: 442711
2021-09-28 17:18:34 +00:00
Xaver Hugl
de674e087a platforms/drm: make failure of findWorkingCombination less severe
While findWorkingCombination should never fail, in the case it does
KWin should not crash. To achieve that simply restore the old config
in case of failure.

CCBUG: 439873
2021-09-28 16:23:01 +00:00
Vlad Zahorodnii
d7d1c6600a wayland: Move ownership of the libinput thread to InputRedirection
When libinput tears down, it may access the Session object. This change
re-jitters the shut down logic so the Session object is guaranteed to be
valid when libinput stuff gets destroyed.

BUG: 442104
2021-09-28 14:37:47 +00:00
Vlad Zahorodnii
7900068cab wayland: Destroy InputRedirection explicitly
CCBUG: 442104
2021-09-28 14:37:47 +00:00
David Edmundson
ef06b8ed95 [effects] Avoid animating screenlocker backing window
ksmserver provides the backing window (the hidden black one) for the
lockscreen. We don't want to animate this fading out.

It no longer provides the logout prompt since several plasma releases.
2021-09-27 14:34:42 +00:00