Commit graph

1096 commits

Author SHA1 Message Date
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
Vlad Zahorodnii
81e7c10a73 Emit DataOfferInterface::dragAndDropActionsChanged() only if dnd actions change
With some apps, firefox specifically, it's possible to enter a dnd
positive feedback loop, e.g.

* kwin sends wl_data_offer::action event
* the app reacts to it and calls wl_data_offer::set_actions() with the
  same actions
* kwin re-sends the wl_data_offer::action event because
  DataOfferInterface::dragAndDropActionsChanged() has been emitted
* the app calls wl_data_offer::set_actions() again, and so on...

This should make D&D in Firefox more responsive.
2021-10-27 15:46:59 +03:00
Vlad Zahorodnii
c45b69595f autotests: Remove interface version assert
It makes the test fail and there's little point for having it.
2021-10-25 21:56:35 +03:00
David Redondo
731ae21cb2 Remove redundant ifs
The resources are already looked up for a specific client.
2021-10-25 08:13:05 +00:00
David Redondo
2aeaf9331b Implement pointer hold gestures interface 2021-10-25 08:13:05 +00:00
Vlad Zahorodnii
e63783df9f Drop legacy virtual desktop api
The plasma window management protocol is intended to be used by
plasmashell. Since kwin and plasmashell have the same release cycle, we
know that the legacy virtual desktop stuff is unused so it can be
dropped to simplify code.
2021-10-25 09:15:42 +03:00
Vlad Zahorodnii
9769969d8c Drop PlasmaWindowInterface::setThemedIcon()
It's unused. KWin uses setIcon() instead.
2021-10-22 18:44:33 +00:00
Aleix Pol
efc7731088 screencast: Implement version 2 of the protocol 2021-10-22 12:49:15 +00:00
Aleix Pol
01645645a7 outputconfiguration: No need to cast, q already is the right type 2021-10-21 23:44:11 +02:00
Rodney Dawes
dff485f13b TextInputV2: Add API to set modifiers map on clients 2021-10-13 14:31:32 -04:00
Rodney Dawes
b58cc08a36 TextInputV2: Don't drop or convert modifiers for keysym events 2021-10-13 14:31:32 -04:00
Rodney Dawes
25942d6fcb InputMethod: Avoid needless complex conversion of key modifiers
As we only need to pass the modifiers around, rather than do anything
internally with them, simply pass them around with minimal conversion.
2021-10-13 14:31:32 -04:00
Alex Richardson
105042ccda Correct the eglQueryWaylandBufferWL_func prototype
I am trying to build against a Qt built without OpenGL. In that case, the
openGL headers have not been included and therefore GLboolean is not
defined. Use EGLBoolean to match the EGL prototype.

See also d18486c033
2021-10-05 11:16:26 +01:00
Vlad Zahorodnii
48d9e4cc0e Automatically close fds for inert resources
If the plasma window resource is inert, the associated get_icon handler
won't be invoked. This results in leaked file descriptors.

With this change, the corresponding close() function call will be
generated to avoid leaking file descriptors and potentially crashing the
session due to kwin running out of fds.

BUG: 438097
2021-09-27 18:02:58 +00:00
Xaver Hugl
ba0d099e38 outputdevice: add missing done events
CCBUG: 442520
2021-09-21 13:34:04 +02:00
Vlad Zahorodnii
5853cc38a1 Send kde_output_device_v1.current_mode to the right resource
Currently, send_current_mode() is called for every mode resource, no
matter whether the given output resource and mode resource belong to the
same client, libwayland-server doesn't like that and it prints a warning
about a compositor bug.

With this change, the output device will remember the mode resources for
every output resource and avoid sending current_mode events with modes
that belong to other clients.
2021-09-20 11:14:50 +00:00
Xaver Hugl
177d35cace Implement drm-lease-v1 2021-09-17 23:10:13 +02:00
Xaver Hugl
3abbc31272 fix rgb range sending
BUG: 442548
2021-09-17 16:36:06 +02:00
Severin von Wnuck
bd9b42912b Fix texture format handling for Nvidia driver 2021-09-17 13:28:13 +02:00
David Edmundson
b219b9175c Only guard DND cancel events with the version check
In a recent refactor a guard seemingly in the wrong place on
SeatInterface was moved into AbstractDataSource, as typically that's
where we guard.

However it turns out the original code was correct, we want to send
cancel for all clipboard cancels, but for D&D it's version dependent.

This class introduces a new method to astract that from seat.
2021-09-10 14:06:49 +00:00
Vlad Zahorodnii
cd512fee2b Fix a typo
It makes more sense to test primarySelection().
2021-09-10 14:27:52 +03:00
David Redondo
efbe1c9664 Introduce AbstractDropHandler
This abstract class represents an object that receives drag and drop
events.
This roughly maps to some of DataDevice's receiving methods, but by
being abstract
also allows us to use the same code from xwayland in a manner
transparent to all
code paths.

Preivous xwayland support with "proxy surfaces" have been removed.

--
In future it will be extended to have the mouse move events, so that we
can
avoid spying on the seat both in dataDevice and kwin's internal filter
2021-09-09 09:04:05 +00:00
David Redondo
0aaed33c66 Move drag logic to seat and introduce SeatInterface::startDrag
A dataDevice has a request to start a drag with multiple parameters.
As kwayland's goal is to turn an event-driven API into a property cache API we
store this data. This patch moves that storage to the Seat as properties of the
active drag, rather than a property of the data device that happened to
initialise it.

This both helps keep a lot of other logic together, but also allows us to expose
a public startDrag method that can be invoked from Kwin's internal surfaces or
xwayland.

Any properties in DataDevice now relate to data being dropped on the device.
2021-09-09 09:04:05 +00:00
Carl Schwan
ea65068fe0 Fix documentation generation
Otherwise all the 'The' are linked to this class and the class is named The
2021-09-07 20:40:22 +00:00
Méven Car
84dd746a2a Fix some warnings 2021-09-03 09:42:16 +00:00
David Redondo
ca92dccbd8 Install all primaryselection interfaces headers 2021-09-03 08:19:15 +00:00
Jan Blackquill
c2680d7108 Implement set_frost in contrast protocol 2021-09-02 22:41:52 +00:00
Xaver Hugl
e31d10c18d output protocols: add rgb range setting 2021-09-01 20:54:14 +00:00
Méven Car
a9458fa031 Remove unused code after cee6912d00 2021-09-01 17:20:38 +00:00
Méven Car
57f8837e39 Fix two ununsed compile warnings 2021-09-01 18:07:03 +02:00
Méven Car
cee6912d00 Implement kde-output-device-v2 and kde-output-management-v2 2021-09-01 12:20:21 +02:00
Aleix Pol
8d9607391c Implement org_kde_plasma_window_management::send_to_output 2021-08-31 17:26:29 +02:00
Alexander Lohnau
525d12bee5 Run clang-format
If you want git blame to ignore formatting revisions run:
git config blame.ignoreRevsFile .git-blame-ignore-revs
2021-08-29 07:11:06 +02:00
Alexander Lohnau
6c163e3260 clang-format: exclude waylandscanner from formatting 2021-08-28 12:40:34 +02:00
Vlad Zahorodnii
2b3e8d6775 Decouple activation feedback from plasma window management global 2021-08-25 09:21:20 +00:00
Aleix Pol
773995de56 plasma-window-management: Support new activation concepts 2021-08-19 18:08:06 +00:00
David Edmundson
aeaa480b0c Add API to record the socket name used by a given file descriptor 2021-08-16 17:37:15 +01:00
Vlad Zahorodnii
d0a0c70d9c Add aboutToBeDestroyed signal to various xdg-shell classes
With the aboutToBeDestroyed signal, the compositor will be able to
perform cleanup before the QObject::destroyed signal is emitted, which
saves us some nullptr checks.
2021-08-12 10:35:13 +00:00
David Redondo
6ba9856a29 Implement wlr-data-control v2
This adds primary clipboard support to data control.
2021-08-12 09:01:08 +02:00