Commit graph

18858 commits

Author SHA1 Message Date
Xaver Hugl
93ee2f6815 Add test for TouchInputRedirection::m_touches 2021-01-18 17:00:47 +00:00
Xaver Hugl
3c23194037 Process TOUCH_CANCEL events from libinput individually
This fixes a bug where cancelled touch sequences get ignored
which results in stuck touch focus.
2021-01-18 17:00:47 +00:00
Xaver Hugl
a4fb852a94 Replace per-device touch slot with global slot
With multiple touch devices the slots could interfere
2021-01-18 17:00:47 +00:00
Méven Car
8bb5b27448 VirtualBackend: make sure the initial dummy VirtualOutput is enabled
Fix tests regressions introduced in 39a1e11958b1ad47d9a516c1cb4bcea852e92a00
2021-01-18 16:57:07 +00:00
Aleix Pol
7ba1937f5c Restart the input method if it crashes 2021-01-18 16:43:05 +00:00
Aleix Pol
05ebe676d2 Introduce a setting to specify an input method
At the moment we are getting the input method from the command line
which is not very handy (but very secure).
This patch changes it so it can be specified from a configuration
setting.

CCBUG: 427972
2021-01-18 16:43:05 +00:00
l10n daemon script
59b1dee55a 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-01-17 06:42:32 +01:00
Vlad Zahorodnii
907480037a cmake: Don't search for Qt5Sensors 2021-01-15 23:30:25 +02:00
Vlad Zahorodnii
15d6be5c0c cmake: Drop Qt5::Sensors dependency
QOrientationSensor is no longer used by kwin.
2021-01-15 23:27:32 +02:00
Vlad Zahorodnii
19461f4413 cmake: Don't list linked libraries in variables
If a non-existing variable is used, no warning will be printed.
2021-01-15 23:18:20 +02:00
Vlad Zahorodnii
2d1994e066 aurorae: Make direct connection to maximizedChanged signal
If the maximizedChanged connection is queued, several configure events
will be sent. If the client acks the first configure event and later on
acks the second one, the maximize animation will be cancelled due to
"unexpected" geometry change.

Based on the code, there is no clear reason why the connection is queued
in the first place.

CCBUG: 431415
2021-01-15 13:26:49 +00:00
Andreas Hartmetz
667177d6cb Prevent unused variable warnings when building for tests 2021-01-15 13:48:23 +01:00
Vlad Zahorodnii
870a9e4d06 Minor pedantic include fixes in FTraceLogger
Project includes must come first; keep Qt includes together.
2021-01-14 22:18:23 +02:00
Vlad Zahorodnii
e68d06b31b Add missing const keyword 2021-01-14 22:13:21 +02:00
Vlad Zahorodnii
e8b045ce14 Remove pointless destructor 2021-01-14 22:11:30 +02:00
Vlad Zahorodnii
b5a1eba277 Properly schedule repaints with premature presentation timestamps
The last presentation timestamp might be in the future by a couple of
hundred microseconds.

This may break timestamp aligning code because it assumes that the
last presentation timestamp is less or equal to the current time.

In order to properly handle this case, we have to first compute the
next expected presentation timestamp by advancing the last presentation
timestamp by the amount of vblank interval. If that fails, we can safely
resort to aligning timestamps.

BUG: 431509
BUG: 431449
2021-01-14 20:45:20 +02:00
Vlad Zahorodnii
242439b8af Minor whitespace fixes 2021-01-14 11:40:22 +02:00
Vlad Zahorodnii
e5abd704de Remove stray file and unused variable
It seems like they were introduced by accident while resolving merge
conflicts.
2021-01-14 11:39:33 +02:00
David Edmundson
85d04cf60d Add ftrace markers
This logs to a tracefs filesystem which can be viewed in tools such as
gpuvis to see precise timings of activities in relation to other trace
markers in X or graphic drivers.

This patch is loosely based on D23114. Though modified with thread
safety, support for string building, and a RAII pattern for durations.
Ultimately that expanded it somewhat.
2021-01-14 09:31:59 +00:00
Méven Car
4f744d1bb6 Add TestOutputManagement::testOutputDeviceDisabled test
Allow VirtualBackend to supports Output changes.
2021-01-14 08:21:59 +00:00
l10n daemon script
866dfb4e89 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-01-14 07:04:00 +01:00
Vlad Zahorodnii
eea823bb67 Remove unused field 2021-01-12 13:06:38 +02:00
Vlad Zahorodnii
0dd79ddb4a Revert "fix: Restore the default properties of dialog window so that the max and min buttons can be customized"
This reverts commit bf5155f82b.

Maximize and minimize function hints provided by some applications are
bogus. This in its turn breaks video games that minimize themselves when
they loose input focus.

Ideally, the window manager should not be concerned about Motif hints
provided by NetWM applications as they set the window type.

BUG: 431450
2021-01-12 10:25:41 +00:00
l10n daemon script
e938a569bc 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-01-12 06:49:28 +01:00
Andrey Butirsky
8d84fe4b6a fix: KeyboardLayoutTest fails
********* Start testing of KeyboardLayoutTest *********
Config: Using QtTest library 5.15.2, Qt 5.15.2 (x86_64-little_endian-lp64 shared (dynamic) release build; by GCC 10.2.1 20201016 (Red Hat 10.2.1-6)), fedora 33
PASS   : KeyboardLayoutTest::initTestCase()
PASS   : KeyboardLayoutTest::testReconfigure()
FAIL!  : KeyboardLayoutTest::testChangeLayoutThroughDBus() 'layoutChangedSpy.wait()' returned FALSE. ()
   Loc: [/home/bam/kde/src/kwin/autotests/integration/keyboard_layout_test.cpp(218)]
FAIL!  : KeyboardLayoutTest::testPerLayoutShortcut() 'layoutChangedSpy.wait()' returned FALSE. ()
   Loc: [/home/bam/kde/src/kwin/autotests/integration/keyboard_layout_test.cpp(286)]
PASS   : KeyboardLayoutTest::testDBusServiceExport()
PASS   : KeyboardLayoutTest::testVirtualDesktopPolicy()
PASS   : KeyboardLayoutTest::testWindowPolicy()
FAIL!  : KeyboardLayoutTest::testApplicationPolicy() 'layoutChangedSpy.wait()' returned FALSE. ()
   Loc: [/home/bam/kde/src/kwin/autotests/integration/keyboard_layout_test.cpp(465)]
PASS   : KeyboardLayoutTest::testNumLock()
PASS   : KeyboardLayoutTest::cleanupTestCase()
Totals: 7 passed, 3 failed, 0 skipped, 0 blacklisted, 16447ms
********* Finished testing of KeyboardLayoutTest *********

- currentLayoutChanged signal has changed to layoutChanged
- per cfcf2baae7, the signal is now emitted
  on every layout change
2021-01-11 11:50:34 +00:00
Srevin Saju
68a7daff58
fix: do not use Implicit QML function call
Qt 5.15 introduced new syntax for defining Connections. Fix warnings like this one:
    QML Connections: Implicitly defined onFoo properties in Connections are deprecated. Use this syntax instead: function onFoo(<arguments>) { ... }

follow up of d2f3372749
2021-01-10 13:35:23 +03:00
l10n daemon script
7205c85b98 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-01-08 06:51:29 +01:00
Andrey Butirsky
c42525693b Remove a basic SNI for keyboard layout
Reverts major part of fe561c5c7d

We now have platform-agnostic QML applet with superior functional, so
this one doesn't needed any more.

CCBUG: 390079
2021-01-07 23:58:15 +00:00
Rosca Alex
c81fe56d7c effects: Add an animation curve to maximize and fullscreen
Replace the default linear easing curve with OutCubic.
2021-01-07 23:51:56 +00:00
Vlad Zahorodnii
49faf6790f Fix a typo 2021-01-07 21:28:00 +02:00
Vlad Zahorodnii
6d20d19fec platforms/x11: Always set swap interval to 1
With the new compositing scheduling, we want the screen to be redrawn as
close as possible to the next vblank. Furthermore, compositing is no
longer driven by a timer. This change removes the NoSwapEncourage swap
strategy as it doesn't make sense now, in addition to that it just does
not work on Wayland.
2021-01-07 13:10:59 +00:00
Vlad Zahorodnii
2e3a6b7253 cmake: Minor cleanups in X11 platform CMakeLists.txt 2021-01-07 12:13:14 +02:00
Vlad Zahorodnii
5bf421ef83 cmake: Specify min version for wayland-protocols 2021-01-07 09:50:55 +00:00
Vlad Zahorodnii
5302094f30 cmake: Link against imported Xinput target 2021-01-07 09:50:24 +00:00
Vlad Zahorodnii
b67f743795 cmake: Drop libkwin's unused Xlib dependencies 2021-01-07 09:50:24 +00:00
Vlad Zahorodnii
c5d97ba04a cmake: Clean up CMakeLists.txt for QPA plugin 2021-01-07 09:49:54 +00:00
Vlad Zahorodnii
3dc00de812 platformsupport: Set PUBLIC include directories
This makes using platform support libs easier.
2021-01-07 09:49:26 +00:00
Vlad Zahorodnii
605988d2a1 platformsupport: Rename some headers to make them less ambiguous 2021-01-07 09:49:26 +00:00
Aleix Pol
199860a007 Fix tests build, provide mocks for libinput functions 2021-01-07 02:56:19 +01:00
Aleix Pol
617651d93e tablet_v2: Use libinput device groups to deduce the device's tablet
We can have pads without tools, tools without pads. This changes how we
figure out which tablet belongs to the input device.
2021-01-06 18:47:59 +01:00
Aleix Pol
3b807e482d tablet: do not show a cursor if no cursor surface was provided 2021-01-06 18:47:59 +01:00
Aleix Pol
1a32c64603 tablet_v2: Support remaining controls
Adds support for tablet buttons, rings and strips.
2021-01-06 18:47:59 +01:00
Vlad Zahorodnii
8f9fcd7eb3 Replace window repaints with layer repaints
Windows have two kinds of repaints - window repaints and layer repaints.
The main difference between the two is that the former is specified in
the window-local coordinates while the latter is specified in the global
screen coordinates.

Window repaints are useful in case the position of the window doesn't
matter, for example for repainting damaged regions, etc.

But its biggest issue is that with per screen rendering, it's not
possible to determine what screens exactly have to be repainted. The
final area affected by the window repaint will be known only at
compositing time. If a window gets damaged, we have to schedule a
repaint on ALL outputs. Understandably, this costs a little bit in terms
of performance.

This change replaces the window repaints with the layer repaints. By
doing so, we can avoid scheduling repaints on outputs that don't
intersect with the dirty region and improve performance.
2021-01-06 16:59:30 +00:00
Vlad Zahorodnii
41718a1d8f scene: Schedule a repaint only for outputs affected by layer repaint
If an output is not affected by a layer repaint, then we don't have to
schedule a repaint. This improves the overall performance.
2021-01-06 16:59:30 +00:00
Vlad Zahorodnii
4a879379b3 scene: Schedule a repaint only if the output is affected by workspace repaint
If an output is not affected by a workspace repaint, then we don't have
to schedule a repaint on that output. This improves the overall performance.
2021-01-06 16:59:30 +00:00
Vlad Zahorodnii
ee3515680a platforms/drm: Make frame scheduling robust
If there is a pending frame, the RenderLoop will delay all schedule
repaint requests to the next vblank event. This means that the render
loop needs to be notified when a frame has been presented or failed.

At the moment, the RenderLoop is notified only about successfully
presented frames. If some frame fails, no repaints will be scheduled
on that output.

In order to make frame scheduling robust, the RenderLoop has to be
notified if a frame has failed.
2021-01-06 16:59:30 +00:00
Vlad Zahorodnii
ad5f8c5c59 Introduce RenderJournal
Currently, we estimate the expected render time purely based on the
latency policy.

The problem with doing so is that the real render time might be larger,
this can result in frame drops.

In order to avoid frame drops, we need to take into account previous
render times while estimating the next render time. For now, we just
measure how long it takes to record rendering commands on the CPU.

In the future, we might want consider using OpenGL timer queries for
measuring the real render time, but for now, it's good enough.
2021-01-06 16:59:29 +00:00
Vlad Zahorodnii
b8a70e62d5 Introduce RenderLoop
At the moment, our frame scheduling infrastructure is still heavily
based on Xinerama-style rendering. Specifically, we assume that painting
is driven by a single timer, etc.

This change introduces a new type - RenderLoop. Its main purpose is to
drive compositing on a specific output, or in case of X11, on the
overlay window.

With RenderLoop, compositing is synchronized to vblank events. It
exposes the last and the next estimated presentation timestamp. The
expected presentation timestamp can be used by effects to ensure that
animations are synchronized with the upcoming vblank event.

On Wayland, every outputs has its own render loop. On X11, per screen
rendering is not possible, therefore the platform exposes the render
loop for the overlay window. Ideally, the Scene has to expose the
RenderLoop, but as the first step towards better compositing scheduling
it's good as is for the time being.

The RenderLoop tries to minimize the latency by delaying compositing as
close as possible to the next vblank event. One tricky thing about it is
that if compositing is too close to the next vblank event, animations
may become a little bit choppy. However, increasing the latency reduces
the choppiness.

Given that, there is no any "silver bullet" solution for the choppiness
issue, a new option has been added in the Compositing KCM to specify the
amount of latency. By default, it's "Medium," but if a user is not
satisfied with the upstream default, they can tweak it.
2021-01-06 16:59:29 +00:00
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