Commit graph

1134 commits

Author SHA1 Message Date
Volker Krause
e5a85f503a QScopedPointer in Qt6 doesn't implicitly cast to bool anymore 2022-03-18 14:34:41 +00:00
Volker Krause
e0c1d2583a Add Wayland includes needed to build against Qt6 2022-03-18 14:34:41 +00:00
Volker Krause
ccad0066e7 Disambiguate KWaylandServer::Display
This unfortunately clashes with a typedef in a Qt6 header.
2022-03-18 14:34:41 +00:00
Volker Krause
6cd0014364 Adapt build system to also support Qt6 2022-03-18 14:34:41 +00:00
Volker Krause
09624c5a9b Make the qtwaylandscanner fork build against Qt6 2022-03-18 14:34:41 +00:00
Aleix Pol
124c78cb4b screencast: Support screencast of regions 2022-03-15 16:09:45 +01:00
Xaver Hugl
215de363e8 linuxdmabuf: port to QVector
QVector is much more suitable for modifiers in KWin than QSet, because you
can access the underlying array
2022-03-15 03:25:50 +01:00
Xaver Hugl
9c5d3c9a70 outputchangeset: set default values for vrr policy and rgb range
If this is not done then KScreen will sometimes unintentionally reset them
to the default.

BUG: 442520
FIXED-IN: 5.24.4
2022-03-11 03:51:18 +01:00
Vlad Zahorodnii
8e304963ad Make pointer focus handling less error prone
Currently, if the pointer surface has to change between two surfaces,
the compositor must do the following

    seat->setFocusedPointerSurface(nullptr);
    seat->notifyPointerMotion(newPos);
    seat->setFocusedPointerSurface(focus);

The pointer motion is needed so the enter event has correct position,
setFocusedPointerSurface(nullptr) is needed to avoid sending a bad
motion event before the leave event.

This change makes the pointer focus api less error prone by splitting
setFocusedPointerSurface() in two functions - notifyPointerEnter() and
notifyPointerLeave().

notifyPointerEnter() takes new focus surface as well as the position
where the pointer has entered the surface so the focus update can be
atomic and without any corner cases.

notifyPointerLeave() is used to clear pointer focus.
2022-03-03 13:35:04 +00:00
Marco Martin
fccbe4e027 Add a methood to fore cancel any drag in progress
This is needed to cancel drags by pressing Escape which is
resposibility of the compositor

CCBUG:405267
2022-03-03 09:09:27 +00:00
Manuel Stoeckl
10b109e31c Add support for [ax]bgr16161616 wl_shm formats
These require Wayland 1.20, for the format definitions.
2022-03-02 09:08:53 +00:00
Heiko Becker
df845939a4 Fix kdebugsettings categories file
By using the same EXPORT for ecm_qt_declare_logging_category and
ecm_qt_install_logging_categories.
2022-02-23 10:14:44 +01:00
Kai Uwe Broulik
6e4acb4303 linuxdmabuf: Add unistd.h include
Don't rely on someone else to pull it in for `close()`

Signed-off-by: Eike Hein <eike.hein@mbition.io>
2022-02-22 15:31:38 +01:00
Aleix Pol
62637c1a92 seat: Do not assert on corner touch cases
Consider the cases where we get a touch move or touch up but we never
received a touch down before.

In the case of move, we'll simulate a touchDown right there and move on
with reality.
In the case of touch up, we'll just ignore the event as simulating could
just be more confusing.

BUG: 450338
2022-02-21 04:08:43 +01:00
Vlad Zahorodnii
9e25fd0468 Add support for xdg_toplevel.configure_bounds()
xdg_toplevel.configure_bounds() allows to indicate the client the
maximum surface size bounds.

wayland-protocols: https://gitlab.freedesktop.org/wayland/wayland-protocols/-/merge_requests/41
2022-02-12 14:14:24 +02:00
Tobias C. Berner
17fc13f100 Add missing errno.h include 2022-02-10 09:11:31 +01:00
Arjen Hiemstra
e6c1ccbd3b Fix drag and drop with touch between different windows
When dragging from one window to another, we may end up in a data_device
that didn't get "data_device_start_drag". In that case, the internal
touch point serial will be incorrect and we need to update it to the
serial from the seat. The serial stored in the seat is changed to
std::optional so we can properly check if it is set.
2022-01-27 10:44:58 +00:00
Vlad Zahorodnii
c793dd93d2 Make data source objects "parentless"
The SeatInterface cleans up currentSelection and currentPrimarySelection
when the AbstractDataSource::aboutToBeDestroyed() signal is emitted, but
since the data source and primary data source have parent objects, they
can be potentially destroyed without emitting the aboutToBeDestroyed()
signal and thus leaving dangling pointers in SeatInterface.

CCBUG: 449101
2022-01-25 09:59:59 +02:00
Xaver Hugl
fd3a7c3c99 linuxdmabuf: remove unnecessary fallback
DRM_FORMAT_MOD_INVALID is now explicitly included in KWin where needed
2022-01-14 17:07:07 +01:00
Vlad Zahorodnii
f06e83f241 Replace resize edges flag with an enum
It's more typesafe.
2022-01-12 14:59:06 +02:00
Vlad Zahorodnii
ee1ea077ba Store surface object in tablet cursor using QPointer
The SurfaceInterface can get destroyed and TabletCursorV2 may return a
dangling pointer.

BUG: 446255
2022-01-10 13:17:32 +02:00
Vlad Zahorodnii
49aadee2a9 Use correct "natural" surface size when computing surface-to-buffer matrix
If the source rectangle is not set, we need to use the surface size
given by the attached buffer. It's computed as buffer size / scale, but
the buffer can also be transformed. In other words, we need to compute
the natural surface size as follows - buffer size / scale and transpose
the result if the buffer is rotated 90 or 270 degrees.
2022-01-08 15:15:14 +02:00
Weng Xuetian
5475751c7b Fix testTextInputV3Interface
Put EnableEmitter in the anonymous namespace to avoid it to be linked to the
wrong implementation.
2022-01-04 11:24:45 -08:00
Xaver Hugl
a011fe74b2 linuxdmabuf: fix sending default tranches
Only the first one was getting sent
2022-01-04 15:22:27 +00:00
Weng Xuetian
afc2a1c0aa Clean up the focus handling for text input.
Usually, a client will only use text input v2/v3. Do not return the focused
surface for text input if it has no relevant text input resource.
If text-input object is created after surface get the focus, send
enter to this text input object. Ensure sendEnter and sendLeave always
appear in pair.

Also, use the same technique in text-input-v2 for text-input-v3 to
handle per resource's enable/disable state, and only send update to
enabled text-input-v3 object.
2021-12-29 00:38:48 +00:00
Xaver Hugl
f2bf7fb1f8 linuxdmabuf: allow setting the default tranches 2021-12-23 00:24:48 +00:00
Weng Xuetian
3ef4f994fa Implemnt preedit_styling for text input v2. 2021-12-19 04:09:48 -08:00
Vlad Zahorodnii
a711f90a69 Include linux/input.h without performing any checks
Currently drag-and-drop doesn't work on FreeBSD because relevant input
parts of kwayland-server are not compiled there.

HAVE_LINUX_INPUT_H is set to 0 on FreeBSD because linux/input.h is in
/usr/local/include and check_include_file() doesn't look there.

Regardless of that, as FreeBSD developers pointed out, including
linux/input.h is the recommended way to get input event codes so let's
make it a hard dependency.
2021-12-17 13:12:31 +02:00
Vlad Zahorodnii
6cdf056047 autotests: Remove unrelated client-side wrapper tests
They belong in KWayland::Client.
2021-12-17 06:56:41 +00:00
Tobias C. Berner
1bc7afe8aa Add helpers to read the executable path for a given PID 2021-12-17 06:54:53 +00:00
Weng Xuetian
2da3276a95 Fix the wrong argument order for send_modifiers. 2021-12-12 23:49:44 -08:00
Vlad Zahorodnii
47897e249f Add ServerDecorationInterface::preferredMode()
This change adds the preferred decoration mode similar to what
XdgToplevelDecorationV1Interface has. It's needed to clean up some kwin
code.
2021-12-08 21:31:17 +02:00
Vlad Zahorodnii
1e84a56df8 Introduce fake None xdg-decoration mode
This is intended for borderless maximized windows. They should be
neither client-side nor server-side decorated.
2021-12-08 21:31:16 +02:00
Xaver Hugl
db91050fb5 dmabuf-feedback: fix crash
BUG: 446502
2021-12-05 13:46:52 +01:00
Xaver Hugl
53064d9af3 linuxdmabuf: implement dmabuf-feedback
dmabuf-feedback allows the compositor to give the client feedback on what
formats and modifiers are best to use, and for which devices it needs to
allocate its buffers, which improves performance and efficiency.
2021-11-30 10:22:31 +01:00
Xaver Hugl
43ccc5910b linuxdmabuf: split out declarations for private classes
The cpp file is getting too long and unwieldy
2021-11-28 13:48:14 +00:00
Arjen Hiemstra
8af2a010c7 Implement drag surface transformation for touch events
Reusing the pointer transformation causes drag with touch to send
completely incorrect coordinates. So implement the "TODO" item about
surface transformation for touch, so we send correct drag events for
touch.
2021-11-17 13:32:00 +00:00
Arjen Hiemstra
1bd496f42b DataDevice: Send enter event with a correct position if we're using touch
It used to send the pointer position, which may be somewhere completely
different when we're using touch.
2021-11-17 13:32:00 +00:00
Arjen Hiemstra
10eb1aa0b9 SeatInterface: Expose firstTouchPointPosition
This exposes "globalTouch.focus.firstTouchPos" so other things can use
it in place of "pointerPos" when touch is being used.
2021-11-17 13:32:00 +00:00
Xaver Hugl
6ffe79dab8 OutputDevice: remove properties
They're unnecessary
2021-11-16 21:31:10 +00:00
Vlad Zahorodnii
f72c2196c7 Calculate correct surface-to-buffer matrix with only upscaled viewport
Currently, if a wp_viewport upscales the surface but doesn't set the
source rectangle, the surface-to-buffer matrix will be calculated
incorrectly.

If the source rect is not set, we need to calculate the source size
based on the buffer size and compare it with the destination size. If
the two are not the same, add a scale transform.

BUG: 445346
2021-11-16 07:24:55 +00:00
Xaver Hugl
357b5c1923 OutputDevice: inline update methods 2021-11-15 12:24:49 +01:00
Xaver Hugl
d166db12b6 OutputDeviceInterface: remove signals
They're unused and unnecessary
2021-11-15 09:46:15 +01:00
Vlad Zahorodnii
128570ed53 Restore correct type check for wl_drm client buffers
With the EGLStreams support gone, we can restore the correct type check
for wl_drm client buffers. The spec suggests to query the
EGL_TEXTURE_FORMAT attribute to determine whether the specified wl_buffer
is a wl_drm buffer.
2021-11-10 13:54:56 +02:00
Xaver Hugl
26233a8dfb Remove the EglStream controller interface
As KWin will no longer use EglStreams it is now unnecessary
2021-11-10 12:29:25 +01:00
Aleix Pol
07a1db9b51 Update to changes in Plasma WaylandProtocols to support primary displays
Adds support for kde-primary-output.
Ports to changes in kde-output-management-v2.
2021-11-08 17:00:37 +01:00
Vlad Zahorodnii
4da5fff033 Correctly apply initial xdg-shell double buffered state
Some double buffered state, e.g. min and max size, should be applied
when the initial state is committed.
2021-11-08 15:49:06 +00:00
Aleix Pol
f4070a23d5 xdgoutput_v1: Do not send a done event to every client when a client binds
When binding we just need to be talking to the one client to make sure
it's set up. This saves us from waking up every other process only to
realise that nothing happened.
2021-11-04 00:21:28 +01:00
Vlad Zahorodnii
fb672f335a Fix ownership of SlideInterface
Similar to other interfaces, the lifetime of the SlideInterface should
be bound to the associated resource.
2021-10-31 12:40:23 +02:00
Vlad Zahorodnii
12946a9ec9 Require the compositor to call IdleInterface::simulateUserActivity() explicitly
In some cases, kwin may decide not to forward input events to the seat.
2021-10-27 17:39:37 +03:00