Commit graph

1757 commits

Author SHA1 Message Date
Vlad Zahorodnii
22ef6d9ddf autotests: Stabilize X11WindowTest
Make a roundtrip to the x server to ensure that WM_STATE changes have
been propagated. xcb_flush() is not good enough, there's still a race
condition between the wm flushing its connection and the client reading
window properties.
2024-03-18 08:46:11 +00:00
Vlad Zahorodnii
f563bade46 autotests: Add desktop tests in X11WindowTest 2024-03-16 10:25:32 +00:00
Harald Sitter
645db7fc90 keyboard_layout: always expose dbus interface
our plasmoid only listens to signals when the interface was found.
also when switching from 2 to 1 layout we'd emit a signal that the
layouts changed but then we'd throw away our interface leaving
the client wondering what happened to us (and consequently
printing warnings because our service wasn't found)

this specifically resulted in the plasmoid not getting layout event
changes when switching from 1 to >1

BUG: 449531
2024-03-15 22:21:08 +00:00
Vlad Zahorodnii
7db47ac2fd autotests: Add a test case for _NET_WM_WINDOW_OPACITY 2024-03-15 21:23:31 +02:00
Vlad Zahorodnii
11a5513e78 Avoid moving the window while it's maximized
Unlike X11, on Wayland, the window won't change its maximize mode until
it renders a new buffer. This creates a problem for interactive move
because if it's not careful and moves the window while it's still effectively
maximized, it will look as if the window has leaked to other screens.

This change fixes the problem by making Window::handleInteractiveMoveResize()
avoid move() if the window needs to be unmaximized.

As a bonus, it also allows to unmaximize the windows that are maximized
along only one dimension by dragging them.

Unfortunately, tiling stuff still suffers from the same issue. In order
to fix it, Window::tile() has to be part of double buffered state, like
Window::maximizeMode().

BUG: 449105
BUG: 459218
CCBUG: 482085
2024-03-15 18:00:52 +00:00
Vlad Zahorodnii
2d5a69b1d2 autotests: Add skip switcher/pager/taskbar tests in X11WindowTest 2024-03-15 17:16:27 +00:00
Aleix Pol
ac9b9a6772 buttonrebinds: Introduce tests
Should help make sure the rebind feature stays working.
2024-03-14 14:39:00 -07:00
Vlad Zahorodnii
0b4c6f8b3b autotests: Reduce amount of boilerplate code in X11 window test 2024-03-14 21:27:05 +00:00
Vlad Zahorodnii
acb4945cd3 autotests: Add more basic X11 window tests 2024-03-14 18:36:41 +00:00
Yifan Zhu
681752ada1 xkb: fix testing if on keypad
XKB_KEY_KP_9 is 0xffb9 while XKB_KEY_KP_Equal is 0xffbd and XKB_KEY_F1
is 0xffbe. So XKB_KEY_KP_Equal, instead of XKB_KEY_KP_9, has the maximum
keysym for keypad keys.
2024-03-11 07:47:58 -07:00
David Edmundson
9302e84b95 wayland: Revert send pointer leave on drag
This was changed to match the behaviour of other compositors.
However what kwin did before is more sensible.

Sending a leave event breaks cursor updates by design. See
https://gitlab.freedesktop.org/wayland/wayland/-/issues/444
2024-03-11 11:32:35 +00:00
Vlad Zahorodnii
4d659998d4 autotests: Make cursor-shape-device-v1 factory function return a std::unique_ptr 2024-03-11 08:52:10 +00:00
Vlad Zahorodnii
46f3c8509c autotests: Make auto-hide-screen-edge-v1 factory function return a std::unique_ptr 2024-03-11 08:52:10 +00:00
Vlad Zahorodnii
a887b737ef autotests: Make idle-inhibitor-v1 factory function return a std::unique_ptr 2024-03-11 08:52:10 +00:00
Vlad Zahorodnii
2922b8d0a7 autotests: Make xdg-toplevel-decoration-v1 factory function return a std::unique_ptr 2024-03-11 08:52:10 +00:00
Vlad Zahorodnii
b4e2241ded autotests: Make factional-scale-v1 factory function return a std::unique_ptr 2024-03-11 08:52:10 +00:00
Vlad Zahorodnii
8a11dde6f2 autotests: Make input panel surface factory function return a std::unique_ptr 2024-03-11 08:52:10 +00:00
Vlad Zahorodnii
98f0af0bc1 autotests: Make wl-subsurface factory function return a std::unique_ptr 2024-03-11 08:52:10 +00:00
Vlad Zahorodnii
f723b11a9a autotests: Make layer shell surface factory function return a std::unique_ptr 2024-03-11 08:52:10 +00:00
Vlad Zahorodnii
af7388c8a3 autotests: Port xdg-shell factory functions to unique_ptr 2024-03-10 17:25:52 +00:00
Yifan Zhu
ad13765348 pointer_input: implement edge barrier between screens
Allow users to configure a virtual edge barrier between screens.
The pointer will only cross over to the other screen after the distance
travelled surpasses edgeBarrier.

Reduce the speed during interactive moveresize, at edges that trigger,
and at the corner.

Only supports wayland. Doesn't have X11 support since it is far too
complicated there.

BUG: 416570
BUG: 451744
2024-03-08 12:03:28 -08:00
Xaver Hugl
7618be3697 opengl/glplatform: remove dependency on OpenGlContext 2024-03-08 17:26:54 +00:00
Xaver Hugl
5aa2606f04 opengl/glplatform: remove GLPlatform::supports method
There's only one "feature" left, so the method for it can be used instead
2024-03-08 17:26:54 +00:00
Xaver Hugl
a8b9e8d262 opengl: remove most of glutils 2024-03-08 17:26:54 +00:00
Vlad Zahorodnii
a489bfa12c wayland: Fix windows shrinking when output layout changes
When the output layout changes, the Workspace is going to update the
struts and then go through every window and see whether it should be
moved or resized.

On the other hand, the layer shell windows react to output changes on
a timer. Furthermore, it's not synchronized with the workspace rearranging
the managed windows. It means that when Workspace::desktopResized() runs,
the panel struts can be slightly outdated, i.e.

- An output layout change occurs
- Workspace::desktopResized() is called but the struts can be wrong
- some time later, LayerShellV1Integration::rearrange is called, it
  fixes layer shell window geometries and struts
- after the layer shell integration has finished rearranging the
  layer shell windows, it calls Workspace::desktopResized(), but the
  damage had already been caused

With the proposed change, the Workspace and the LayerShellV1Integration
will rearrange the windows in sync.

CCBUG: 482361
2024-03-07 13:41:01 +02:00
David Edmundson
b650f55d60 xwayland: Add unit test for XWayland key tracking 2024-03-03 12:41:15 +00:00
Aleix Pol Gonzalez
bf1ce85474 Make it possible to build KWin without libxcb
Now that we have Wayland around, there's a whole branch of dependencies
that shouldn't be necessary anymore.
This allows to build KWin without all of it, allowing us to have a much
more compact alignment for cases where all the legacy software isn't
necessary anymore.

Bundle KWindowSystem X11-specific headers into it too, since it's part
of the same process.

Signed-off-by: Victoria Fischer <victoria.fischer@mbition.io>
2024-02-28 16:03:50 +00:00
Vlad Zahorodnii
d8e8f952a2 Allow maximizing the window by double clicking borders
It's a more intuitive way to maximize a window either horizontally or
vertically.

BUG: 480848
2024-02-27 23:27:22 +02:00
Vlad Zahorodnii
a8a53c651b Port away the remaining users of windowShown/windowHidden to hiddenChanged 2024-02-27 20:58:52 +00:00
Xaver Hugl
765cd82613 autotests/test_colorspaces: add an autotest for non-normalized primaries 2024-02-27 15:14:20 +00:00
Vlad Zahorodnii
d13b6db706 x11: Refuse starting move/resize operation with no pressed buttons
If the client is slow, kwin can receive _NET_WM_MOVERESIZE requests
after user has released mouse buttons. Ideally, the window manager
should refuse starting an interactive move/resize operation in such a
case so it's still possible to finish moving or resizing the window
by releasing mouse buttons.
2024-02-27 12:12:32 +02:00
David Edmundson
32be54b19d x11window: Disable strict geometry placement by default in wayland
Strict geometry disables certain user activites; full screen requests
and only sending configure events at sizes the client claims to support.

This was added as a workaround for xterm in 19 years ago. It's a client
side bug as applications can still choose to ignore the configure event,
so kwin shouldn't have to sanitise them in advance. xterm seems to have
fixed it's bug, and pragmatically we know not all window managers
perform these checks so most clients should not be relying on it.

On Wayland this additional check is proving problematic, the handling of
scaling especially fractional scaling is hitting cases where it's better
to always ask the client to do what kwin wants.

Tests that refer to sizeIncrements are dropped as they are only used in
the strict geometry passes which is being obsoleted. Resizing in general
is still tested.

BUG: 481456
2024-02-26 10:32:49 +00:00
Aleix Pol Gonzalez
79dd34b3f9 Do not rely on NETWM for the main Window class
NETWM forces a weird X11 dependency on KWin that doesn't necessarily
match what we want to do. Instead we decouple such a central class in
KWin like it's Window from KWindowSystem X11 support.

Signed-off-by: Falko Becker <falko.becker@mbition.io>
2024-02-20 18:04:06 +00:00
Xaver Hugl
8fa782f1a8 autotests/integration/outputchanges: add geometry restore test 2024-02-19 17:18:28 +01:00
Xaver Hugl
8c543dbe7c xkb: caps lock is not shift lock
Caps lock only locks capitalization of letters, making it artificially also
trigger shift in the context of KWin only causes problems
2024-02-14 14:25:03 +00:00
David Edmundson
5386360928 wayland: Send wl_pointer leave before data_device enter
SeatInterface currently has a separation of kwin's focus scope to
pointer input with early return guards in notifyPointerEnter and
notifyPointerLeave where clients don't get pointer events.

However we don't update the initial state when a drag is started, this
patch notifies sends a pointer leave to the new drag target before the
data_device enter so things are consistent.

This also brings it in line with Weston and Mutter.

notifyPointerLeave has it's early return removed as for wayland windows
as we know nothing will have pointer focus.
2024-02-14 12:39:32 +00:00
Vlad Zahorodnii
8a9cb06b41 Adapt to NETRootInfo::moveResize() changes 2024-02-14 10:43:00 +00:00
Xaver Hugl
8f27ee0cb8 input: remove hasAlphaNumericKeyboard method
It's completely unreliable
2024-02-12 18:19:23 +01:00
Vlad Zahorodnii
b1908949d0 autotests: Use ShapeCursorSource to load reference cursor images in testPointerInput 2024-02-07 08:46:20 +00:00
Vlad Zahorodnii
c9c84b6859 Prefer cursor shape names from the CSS W3C specification
There is a mix of cursor shape names from the CSS W3C specification and
non-spec ones, which is confusing when deciding what cursor shapes need
aliases in Cursor::cursorAlternativeNames().
2024-02-07 08:35:52 +00:00
Vlad Zahorodnii
aac5d562fb Drop "<N>" window caption suffix
The current implementation of the `<N>` suffix is still buggy and its
benefits are doubtful. One could argue that visual aids such as window
thumbnails or highlighting the windows are better. On its own, these
numbers don't have strong connections to the windows and can change on
a whim.
2024-02-05 11:10:53 +02:00
Xaver Hugl
67b1a88466 autotests/integration: re-enable lid closed output changes test
KWin is handling the lid switch now
2024-02-02 01:59:36 +01:00
Xaver Hugl
9c0085f5a9 colorspace: make sdr colorimetry not be about rec.2020 anymore
This was just done because of the wrong assumption that displays needed that
to show the full native gamut. That turned out to be an amdgpu bug though; with
that fixed, most of the 0-100% range is wildly oversaturated.
To make the slider more intuitive, this changes the sdr gamut wideness to instead
interpolate to the native display primaries as indicated by the EDID.
2024-01-31 13:23:03 +01:00
Vlad Zahorodnii
def3a50558 Ignore external updates of _NET_DESKTOP_LAYOUT and _NET_DESKTOP_NAMES
At the moment, the desktop layout in _NET_DESKTOP_LAYOUT overwrites new
desktop layout with outdated information. This happens because kwin tries
to honor the desktop layout set by the pager. However, kwin itself
already acts as the pager. The pager applet in plasma doesn't attempt to
maintain _NET_DESKTOP_LAYOUT with proper values.

On the other hand, kwin trying to both update and also sync its state to
_NET_DESKTOP_LAYOUT and _NET_DESKTOP_NAMES has created a series of
issues, like lockups or rendering glitches.

Given that the window manager can ignore these properties, and the fact
that kwin already does act like a pager, this patch makes kwin ignore
external updates to _NET_DESKTOP_LAYOUT and _NET_DESKTOP_NAMES.

In order to modify the desktop layout on X11, use the dbus api. On
Wayland, either the dbus api or the virtual desktop wayland protocol.

BUG: 422319
BUG: 480371
2024-01-30 14:14:09 +02:00
Vlad Zahorodnii
e23cb52a16 wayland: Add windows when readyForPainting changes
A window is added to the workspace when it's mapped. It's assumed that
the first Window::windowShown signal indicates that. But it's not
entirely true. For example, if setHidden(false); setHidden(true); are
called in succession, the window will be marked as ready for painting
even though it isn't.

The Window::readyForPaintingChanged() signal fixes that. It's emitted
when the window is actually mapped.
2024-01-29 12:35:10 +02:00
Vlad Zahorodnii
2d399e93f0 Relax constraints for screen edges reserved by windows
At the moment, if the workspace extends or shrinks by an output, the
hidden panel will be shown. It doesn't make sense in all cases.

Furthermore, no screen edge will be reserved if the layer surface has
some margins.

To address that, allow "floating" panels reserve screen edges and also
make kwin try harder to preserve window edges if the output layout
changes.

CCBUG: 448420
2024-01-29 11:14:15 +02:00
Vlad Zahorodnii
1eb95982dc autotests: Disable outline in breeze
Some our tests assume that with "none" border size, the decoration has
no borders. When breeze paints an outline, that's not the case.
2024-01-29 11:04:05 +02:00
Vlad Zahorodnii
b21229e59a wayland: Implement closeable window rule
BUG: 443129
2024-01-29 10:57:29 +02:00
Vlad Zahorodnii
1b6aa65ee5 autotests: Add layer_surface_v1.set_exclusive_edge test cases 2024-01-26 13:55:13 +02:00
Vlad Zahorodnii
9cdf19c657 autotests: Add keypad global shortcuts test 2024-01-24 13:20:58 +00:00