Commit graph

1202 commits

Author SHA1 Message Date
Vlad Zahorodnii
c09a03a927 Drop Platform::touchPointCount()
It can be accessed directly in the touch input device handler.
2021-10-28 10:55:48 +00:00
Andrey Butirsky
e4e920d895 [testBorderlessMaximizedWindow] add touch to the test
BUG: 411884
2021-10-22 09:47:28 +00:00
Andrey Butirsky
83ece2e2a8 unit test for focusing loss problem on maximize
BUG: 411884
2021-10-22 09:47:28 +00:00
Vlad Zahorodnii
252ba9e005 autotests: Use less Screens::size(int)
The same info can be retrieved from AbstractOutput::geometry().size().
2021-10-22 09:15:48 +00:00
Vlad Zahorodnii
15520888d9 kwineffects: Drop numScreens property
The screen count can be retrieved by checking the number of items in the
EffectHandler.screens property.

The replacement for the numberScreensChanged signal are the screenAdded
and the screenRemoved signals.

The main motivation behind this change is to clean up the screens api
and reduce the number of usages of the Screens class.
2021-10-22 09:14:52 +00:00
Vlad Zahorodnii
701902fbec effects: Port effects from int screens ids to EffectScreen
EffectScreen objects are better as they are more stable and we avoid int
screen ids in kwin core.
2021-10-20 12:09:09 +00:00
Alexander Lohnau
dffbfcc9f7
Fully port away from KPluginLoader 2021-10-19 21:39:51 +02:00
Alexander Lohnau
e431b453b6
Port away from KPluginLoader::findPlugins 2021-10-19 21:19:23 +02:00
Vlad Zahorodnii
141947d2e8 effects: Link builtin effects with executables
The main motivation behind this change is to prepare kwin for importing
kwayland-server code in libkwin.

As is, builtin effects are linked with libkwin. Some builtin effects
have wayland specific code. If we move wayland stuff in libkwin, there's
going to be a circular dependency between kwin4_effect_builtins and
libkwin targets.

This change intends to break that dependency by linking builtin effects
to kwin executable.

The main issue with that is that EffectLoader would need to discover the
effects indirectly. QStaticPlugin is used for that purpose.

Besides breaking the cyclic dependency, it makes builtin effects use the
same plugin infrastructure in libkwineffects that external effects use.

Metadata in src/effects/effect_builtins.cpp was converted in a list of
python dictionaries, which was fed to a python script that generated
main.cpp and metadata.json files.
2021-10-19 09:12:15 +00:00
Aleix Pol
a9ccfba768 Fix inputmethodtest
We needed to simulate a touch event so that it doesn't decide to ignore
the next events.
2021-10-18 15:55:39 +00:00
Vlad Zahorodnii
d4dd370cf3 autotests: Fix ASAN issues
Currently, InputRedirection is not destroyed before waylandServer(),
unlike in kwin_wayland, which causes some null dereferencing.
2021-10-14 22:03:39 +03:00
Vlad Zahorodnii
b4a4e8a45d Drop WaylandServer::terminateClientConnections()
Display will destroy all client connections before getting destroyed.
2021-10-14 10:02:50 +00:00
Vlad Zahorodnii
e550480c43 Rework input method teardown logic
Explicitly destroy input method rather than wait for the input method
connection to be destroyed by WaylandServer, it's less error prone.

BUG: 443603
2021-10-14 10:02:50 +00:00
Vlad Zahorodnii
bf620fbe04 Move Xkb::LEDs enum to KWin namespace
With the LEDs enum being defined in kwinglobals.h, wayland_server.h
won't need to include keyboard_input.h, which is good for compilation
times and wayland_server.h will drag less stuff, e.g. QtWidgets (input.h
includes QAction)
2021-10-13 17:49:19 +00:00
Nate Graham
c1fb405b8d Rename "pack" actions for clarity
The English word "pack" is not really the correct word for these
actions, and does not succeed in communicating what they will do. Since
the actions simply move the active window as far as it will go in the
specified direction, the actions can be renamed to say that instead.

Also rename the action names in the code to match their new UI text for
clarity.
2021-10-13 14:28:23 +00:00
Vlad Zahorodnii
d0fd2224bf autotests: Use EffectLoader to list all available effects
EffectLoader is a more generic way to list all available effects.
2021-10-12 06:33:30 +00:00
Vlad Zahorodnii
260b224d3b Drop WaylandServer::dispatch()
There's no any good reason to dispatch events at shutdown.
2021-10-12 06:32:55 +00: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
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
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
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
Vlad Zahorodnii
ca1c72dd16 wayland: Fix cross cursor in Xwayland apps
Startup code in plasmashell was changed so xsetroot is not called
anymore, which is sort of fine.

Unfortunately (or not?), it exposed a bug in kwin. Cursor::x11Cursor()
only works in the standalone X11 session.

On Wayland, Cursor::x11Cursor() will return XCB_NONE which results in
seeing cross cursor when there should be arrow cursor.

This change moves xcb_cursor_t look up code from X11Cursor to the base
Cursor class. In hindsight, I would like to introduce a window manager
class where the xcb cursor and other x11 specific code can be moved in
the future for better encapsulation of platform-specific code.

CCBUG: 442539
2021-09-23 13:52:51 +00:00
Méven Car
2eb5da1d6f Port autotests/integration/outputmanagement_test to kde_output_management_v2 2021-09-14 14:42:31 +00:00
David Edmundson
a4cdcb6c87 Fix xwayland copying unit test
The current code set m_pasteProcess to null, before running the cleanup
function which tells the process to quit.

Which is why it always hung the CI. This patch addresses it in a way
that cleans up helpers even if we abort the test early.
2021-09-09 11:13:02 +00:00
Vlad Zahorodnii
82dd480196 autotests: Fix testMoveResize
"2" is a copy paste typo, the expected number of outputs is 1.
2021-09-07 20:51:48 +03:00
Vlad Zahorodnii
2d9207e251 autotests: Fix testSceneQPainter
Scene::qpainterRenderBuffer() was ported to AbstractOutput but not
testSceneQPainter, which results in a few broken tests.
2021-09-07 17:44:10 +00:00
Vlad Zahorodnii
200223e06e autotests: Prepend KWayland::Client:: to Surface
With a "Surface" type in kwin, KWayland::Client::Surface without fully
specified namespace will conflict with kwin's Surface type.

In some way, it also improves readability as it's clear where Surface
comes from.
2021-09-06 10:42:03 +00:00
Ismael Asensio
9995f984c3 kwinrules: Use a list of desktop UUIDs to set and store the rules setting
Port the RuleSettings and KCM to store and use a list of virtual desktop
 UUIDs, instead of the previous x11 positional id, continuing the work on
This allows to set a rule with several desktops on Wayland.

On X11 it has no visible change for the user, but internally it uses the
more modern concept, helping to simplify the related code.

The relevant key on kwinrulesrc changes from `desktop` to `desktops`.
A kconf_update script handles the migration.
2021-09-02 22:11:46 +02:00
Janet Blackquill
6231699ac1 Lay some groundwork for realtime gestures in Wayland
This lays down some groundwork for realtime gestures in Wayland,
so that gestures that are 1:1 with user motion on a touchpad are
now possible to implement.

Due to earlier commits, this is mostly just glue code to make a
convenient API.

Gestures implemented with this API are four-finger gestures, to
avoid conflicting with apps that may use two or three-finger
gestures.
2021-09-01 19:48:41 -04:00
Méven Car
0a2c511489 Wayland: Add support for protocol kde-output-device_v2, allow to detect drm mode changes
CCBUG: 407058
2021-09-01 13:37:43 +00:00
Vlad Zahorodnii
543145e76f autotests: Port common screen check preamble to AbstractOutput 2021-08-31 08:16:27 +00:00
Xaver Hugl
93ec5d8ea9 tests: fix GestureTest 2021-08-31 01:45:27 +00:00
Xaver Hugl
5b87c24568 tests: fix TestBuiltInEffectLoader 2021-08-31 01:45:27 +00:00
Xaver Hugl
36f01ba7fe tests: fix TestVirtualDesktops 2021-08-31 01:45:27 +00:00
Vlad Zahorodnii
901e479482 autotests: Rewrite testScreenEdges as an integration test
Due to the screen edges test not being an integration test, it's very
hard to change output related code in libkwin. screens.cpp needs to have
a few ifdefs to successfully compile.

This change rewrites the screen edges test as an integration test in
order to allow us using other components of kwin in screens.cpp and
screenedge.cpp without ifdef guards.

It's not a one-to-one port.
2021-08-30 14:46:00 +00:00
Vlad Zahorodnii
7016da39c8 Move active output tracking to workspace
Active output is a window management concept. It indicates what output
new windows have to be placed on if they have no output hint. So
Workspace seems to be a better place for it than the Screens class, which
is obsolete.
2021-08-30 13:28:23 +00:00
Vlad Zahorodnii
b08807cc36 autotests: current abstract output 2021-08-30 13:28:23 +00:00
Vlad Zahorodnii
6ca411a84a Port AbstractClient::sendToScreen() to AbstractOutput 2021-08-29 21:55:07 +00:00
Vlad Zahorodnii
507c5140b7 Port Workspace::topClientOnDesktop() to AbstractOutput 2021-08-29 21:55:07 +00:00
Vlad Zahorodnii
5bbd21f682 autotests: Port away from deprecated clientArea() overloads 2021-08-25 18:53:53 +00:00
Vlad Zahorodnii
78b5330824 Drop VirtualDesktopManager::name()
It's confusing to have two ways to query the same information.
2021-08-25 20:12:07 +03:00
Aleix Pol
9a4bbdf226 Make it possible for an effect to render a screen
Useful in case it needs the contents of the screen but they can't be
blitted, as the state of the framebuffer is unknown.
2021-08-25 14:44:03 +00:00
Vlad Zahorodnii
fddbd57d09 Port Workspace::clientArea() to VirtualDesktop
This makes Workspace APIs that take virtual desktops more consistent.
2021-08-25 14:31:30 +00:00
Vlad Zahorodnii
ba0f5981bf Port Workspace::slotWindowToDesktop*() to VirtualDesktop 2021-08-19 11:08:32 +00:00
Vlad Zahorodnii
6132329c2c Add Overview effect
This effect is meant to be as a replacement for the present windows and
the desktop grid effect. It is written using QML.

So far, this effect implements only the basic features of the present
windows effect. Desktop management features will be added later.

CCBUG: 295775
CCBUG: 303438
2021-08-19 06:30:55 +00:00
Vlad Zahorodnii
b75f089981 Port Workspace::topClientOnDesktop() to VirtualDesktop
This patch has one behavioral change - raiseOrLowerClient() will not
work if the client is not on the current virtual desktop.

However, raiseOrLowerClient() can be called only in two cases:

* user triggers the raise or lower shortcut for the active client. Since
  the active client is on the current virtual desktop, it's not an issue

* an x11 window restacks itself. It makes no sense if an x11 window
  restacks itself while it's inactive or not on current virtual desktop.
  Also, the Opposite restack mode is rarely used, some window managers
  don't even bother implementing it. So, having such a constraint should
  not be a problem.

The main reason for not allowing raiseOrLowerClient() for windows that
are not on the current virtual desktop is that a window can be on
multiple virtual desktops. If a window is on A and B virtual desktops,
the only logical option is to toggle stacking position if the window is
on the current desktop. It's the only viable option as kwin does not
maintain per virtual desktop stacking order.
2021-08-17 06:23:52 +00:00