Commit graph

18910 commits

Author SHA1 Message Date
Vlad Zahorodnii
a3ec0c9a57 Delegate repaint scheduling to the Scene
In order to unlock per screen rendering, we need to track repaints for
every screen individually. While we could do this in the Compositor class,
tracking repaints in the Scene seems a better alternative in long run
because we will have to instantiate a Scene for each composited screen
one day.
2021-01-06 16:59:29 +00:00
Vlad Zahorodnii
992e88de50 Perform compositing even if there is nothing to repaint
In rare cases, the Compositor has to perform a compositing if there is
nothing to repaint. For example, if a client has committed a frame
callback to get notified about the next vblank event without damaging
the surface.
2021-01-06 16:59:29 +00:00
Vlad Zahorodnii
fc60e8f1e3 platforms/x11: Present buffers even if nothing has been changed
This is needed to ensure that the compositor always receives swap events
even if nothing has been changed on the screen.
2021-01-06 16:59:29 +00:00
Vlad Zahorodnii
bc9df67c79 platforms/wayland: Present buffers even if nothing has been changed
Present buffers event if nothing has been changed on the screen because
we want to receive the frame callback.
2021-01-06 16:59:29 +00:00
Vlad Zahorodnii
58cb4de1b8 platforms/drm: Present buffers even if nothing has been changed
We want to get notified when the next page flip occurs. The problem is
that kwin will avoid queueing a page flip if nothing has been changed on
the screen. From performance point of view, that is expected behavior,
but for frame scheduling and some wayland clients that create frame
callbacks to get notified about the next vblank, it's not suitable.
2021-01-06 16:59:29 +00:00
Vlad Zahorodnii
ef6fa25d90 platforms/x11: Split out the EGL for X11 backend
EGL for X and EGL for Wayland backends are quite different. The main
motivation behind this change is to prepare the EGL backends for
monitoring vblank events. Things work quite differently depending on
if the EGL backend renders onto a toplevel window or overlay window.
2021-01-06 16:59:29 +00:00
Vlad Zahorodnii
4f3adbb520 Drop SGI_video_sync based method for vsync
With the new compositing timing, we want to start compositing some time
later after a vsync event. This doesn't go along with the video sync
based method to synchronize buffer swaps with vblank.

Since practically all drivers nowadays provide support for the swap
control extensions (GLX_EXT_swap_control, GLX_SGI_swap_control, or
GLX_MESA_swap_control), it's safe to rely on them for the purpose of
synchronizing buffer swaps to vblank.
2021-01-06 16:59:29 +00:00
Vlad Zahorodnii
7a3fa88f02 Drop flag to indicate if swap buffers is blocking
We want the new compositing timing algorithm to be invariant regarding
whether glXSwapBuffers() or eglSwapBuffers() block.
2021-01-06 16:59:29 +00:00
Vlad Zahorodnii
2152598cc4 Drop the swap profiler
In hindsight, we want to swap buffers after finishing a compositing
cycle, therefore there is no need for the swap profiler.
2021-01-06 16:59:29 +00:00
Vlad Zahorodnii
0ceff5fd24 Swap buffers after finishing a compositing cycle
The compositing timing algorithm assumes that glXSwapBuffers() and
eglSwapBuffers() block. While this was true long time ago with NVIDIA
drivers, nowadays, it's not the case. The NVIDIA driver queues
several buffers in advance and if the application runs out of them,
it will block. With Mesa driver, swapping buffer was never blocking.

This change makes the render backends swap buffers right after ending
a compositing cycle. This may potentially block, but it shouldn't be
an issue with modern drivers. In case it gets proven, we can move
glXSwapBuffers() and eglSwapBuffers() in a separate thread.

Note that this change breaks the compositing timing algorithm, but
it's already sort of broken with Mesa drivers.
2021-01-06 16:59:29 +00:00
Vlad Zahorodnii
ed88cbfb65 cmake: Remove FindFontconfig.cmake
It's in extra-cmake-modules now.
2021-01-06 11:21:03 +02:00
Nate Graham
3800181ac2 Revert "cmake: Remove redundant include_directories()"
This reverts commit 9b1ea1c7f7.

This breaks compilation; apparently the include is not implicit and is
thus needed after all.
2021-01-05 19:29:15 -07:00
Jan Blackquill
a92b465f8f Implement xdgshell v3 2021-01-06 01:08:25 +00:00
Vlad Zahorodnii
26b249061e cmake: Remove FindUDev.cmake
It's in extra-cmake-modules now.
2021-01-05 23:08:47 +02:00
Vlad Zahorodnii
9b1ea1c7f7 cmake: Remove redundant include_directories()
libkwin is linked against imported XKB::XKB target. Thus the
include_directories() is redundant.
2021-01-05 22:58:04 +02:00
Vlad Zahorodnii
7e5c16989e Drop hwcomposer backend
Plasma Mobile announced that they plan to drop support for Halium
devices, see the announcement blog post [1] for the reasons that led to
such a decision.

But just to summarize, here are some of the key points from the post:

 * Some of our team members no longer have access to reference LG Nexus
   5X device anymore
 * After KDE Neon switched to using Ubuntu 20.04 we no longer are
   updating the rootfs for halium devices
 * After several important architecture changes in upstream KWin, the
   hwcomposer backend might be broken and we have no way of verifying it

If the community members are interested in reviving the hwcomposer
backend,

  * it pretty much needs rewrite/re-thinking given differences of hwc1
    and hwc2 API for hwcomposer part of it, see also [2]
  * It also needs removal of Android 5 based libhardware API as we don't
    think code can be kept sane with 3 different levels of ifdefs
  * This backend needs better way of fixing difference between
    CAF/non-CAF devices then just recompiling with different headers,
    maybe env vars?
  * This backend does not support various things like transformation/
    rotation etc, and is not exactly feature complete as the DRM backend

[1] https://www.plasma-mobile.org/2020/12/14/plasma-mobile-technical-debt.html
[2] 83f563c339
2021-01-05 17:38:36 +00:00
David Edmundson
ae440bdc25 Bump libkwineffects so version
There was an ABI breaking change when presentation times were added.
It has not been bumped since Plasma 5.20
2021-01-05 14:14:28 +00:00
Ismael Asensio
6eda92a0fd kcm/kwinrules: Detect and suggest activities from a window
Add the activities info to the list of properties provided by
the `queryWindowInfo()` dBus method, and suggest them to the
user when inspecting a given window.

An empty activity list means "All Activities" (null UUID)
Also get the null UUID value instead of having it hardcoded.
2021-01-05 14:31:07 +01:00
Cyril Rossi
8a79f38de8 KCM KWinScripts implement KCModuleData to highlight default at module level
Use highlight in KPluginSelector
Also remove PluginKeyword in .desktop file
2021-01-05 08:53:04 +00:00
Ismael Asensio
247d9c38d1 kcm/kwinrules: Restore method textOfValue()
This convenience invokable method was removed in 66ee89855
by mistake, since it's still used in RulesEditor.qml

While at it, optimize arguments to const &
2021-01-04 19:30:00 +01:00
Vlad Zahorodnii
93194a6720 autotests: Convert testScreens into an integration test
At the moment, the Screens class is convoluted with ifdefs because of
MockScreens.

The goal of this change is to reduce the number of usages of the
MockScreens class so it is possible to get rid of the ifdefs.
2021-01-04 08:32:57 +00:00
Vlad Zahorodnii
c324cd1464 Remove Findepoxy.cmake
It's in extra-cmake-modules now.
2021-01-04 08:32:04 +00:00
Michael Tunnell
5193658aa2 Apply Initially as default value of new Properties
Change the default value from "Do Not Affect" to "Apply Initially" when
adding new properties in Window Rules.

REASON: prior "Do Not Affect" as default and occasionally I forget to
change the setting to something else when adding new properties.
Unfortunately, this means I forget to do it and so it isn't saved when
I close the window. I will then go back in to change it to Apply Initially
or in some cases have to add the new property again as it wasn't saved in
the set.

I think if Apply Initially were to be the default it would be an easier
and faster experience to add new properties.
2021-01-04 01:52:39 +00:00
Ismael Asensio
66ee898556 kcm/kwinrules: Allow to select multiple activities
This commit addresses the UI part

BUG: 430499
2021-01-04 00:34:34 +01:00
Ismael Asensio
fc1553e8ee kwinrules: Allow multiple activities in rule settings
Change the setting's type from `QString` to `QStringList`
and adjust relevant code.

Previous config requires no porting as a single string in the
config file is read as the first item in the list.
2021-01-03 23:03:45 +01:00
Vlad Zahorodnii
ccfaf1a1d6 cmake: Rework how tabbox is conditionally compiled into libkwin
In modern CMake code, it is highly advised to avoid using variables. One
should instead try to use targets and properties more extensively.
2020-12-31 11:00:27 +00:00
Vlad Zahorodnii
9af78c0e7f cmake: Rework how activities support is compiled into libkwin
In modern CMake code, it is highly advised to avoid using variables. One
should instead try to use targets and properties more extensively.
2020-12-31 11:00:27 +00:00
Vlad Zahorodnii
d16c15301f cmake: Rework Findepoxy.cmake
This makes Findepoxy.cmake more upstreamable and easier to use.
2020-12-31 10:52:03 +00:00
Kai Uwe Broulik
5edfccac12 KRunner integration: Send window pixmap along
If there is no icon name available which is very often
the case on X11.

BUG: 430054
2020-12-29 21:22:36 +00:00
Vlad Zahorodnii
810186222b cmake: Fix a typo in Findlcms2 2020-12-29 19:54:10 +02:00
Vlad Zahorodnii
70458eb280 plugins/nightcolor: Handle new color devices
This ensures that new outputs have the right color temperature.
2020-12-21 20:43:17 +02:00
Vlad Zahorodnii
8b03fc9e07 Fix minor coding style issues
The coding style guidelines recommend to keep line width under 100
characters if possible.
2020-12-21 20:27:35 +02:00
Vlad Zahorodnii
eaf94f465c Re-apply color transforms when session is re-activated
When our session is re-activated, we need to re-apply color transforms
as the current gamma ramps might be outdated.
2020-12-21 20:25:32 +02:00
Vlad Zahorodnii
6adfe3064f Drop Platform::createScreens()
Since the Screens class is a convenience wrapper around AbstractOutput
objects that come from the Platform, it should not be platform-specific.

By dropping createScreens(), output-related code becomes simpler.
2020-12-21 09:20:16 +00:00
Vlad Zahorodnii
935a6d7e21 platforms/x11: Drop XRandrScreens::displaySize()
The default implementation of Screens::displaySize() returns the
bounding rectangle of all available outputs.

In case the Xrandr extension is unavailable, there will be a fake
output whose dimensions are the same as the dimensions of all screens
combined.
2020-12-21 09:20:16 +00:00
Vlad Zahorodnii
2567d0c935 platforms/x11: Init outputs during platform initialization 2020-12-21 09:20:16 +00:00
Vlad Zahorodnii
8a606e47c4 platforms/x11: Introduce X11PlaceholderOutput
It is useful in case the Xrandr extension is unavailable or no outputs
are connected.
2020-12-21 09:20:16 +00:00
l10n daemon script
1a40632fbc 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-12-21 06:45:06 +01:00
Vlad Zahorodnii
d70e6c2c69 Avoid destroying yet alive color devices
This is a typo that I forgot to fix, therefore not requesting code
review. After QVector::erase() has been called, we cannot use the
iterator as it will lead to undefined behavior.
2020-12-20 17:31:00 +02:00
Daan De Meyer
38f55c81f3 Add .gitignore file to ignore generated .clang-format 2020-12-18 10:03:45 +00:00
Vlad Zahorodnii
79ca5ccd26 Merge OutputScreens into Screens
Since all platforms have been ported to AbstractOutput, OutputScreens
can be merged into Screens. This simplifies the class hierarchy.
2020-12-17 13:36:30 +00:00
Cyril Rossi
0420048405 KCM KWinCompositing implement KCModuleData to highlight default at module level
Fix Rendering backend combobox that was not highlighted.
Particular case due to OpenGLIsUnsafe kcfg entry which is an indicating
flag and not a configurable setting.
2020-12-17 13:21:23 +00:00
Vlad Zahorodnii
c812b1b8d2 Spy on the right signal in KeyboardLayoutTest 2020-12-17 13:47:29 +02:00
Vlad Zahorodnii
a8dd455953 Fix DebugConsoleTest
The debug console now displays window ids as hexidecimal numbers.
2020-12-17 13:15:46 +02:00
Vlad Zahorodnii
267eb0e9fa Fix NightColorTest
Currently, the test crashes because the ColorManager is not created.
2020-12-17 13:03:18 +02:00
Vlad Zahorodnii
533ec39af5 Fix PlasmaSurfaceTest
Opaqueness is not based on the window type.
2020-12-17 13:00:46 +02:00
Vlad Zahorodnii
a2c765800b Drop Screens::supportsTransformations
It's used nowhere.
2020-12-17 07:36:50 +00:00
l10n daemon script
58ae454f6b 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-12-17 06:47:43 +01:00
Adriaan de Groot
b42e4d1884 Missing includes (for strdup() and strlen()) 2020-12-16 13:53:24 +01:00
Adriaan de Groot
002d4737ee Use execvp() instead of execvpe()
Nothing here changes environ directly, and we're not interested
in passing a specific custom environment to kwin_wayland, so
don't use the (Linux-only) execvpe() for passing environment.
2020-12-16 13:53:24 +01:00