Commit graph

783 commits

Author SHA1 Message Date
Oleg Chernovskiy
300cd607f0 Implement releasing of client-freed output
Summary:
Previously KWin supported only version 2 of wl_output interface
In third version there was an important addition that allowed clients to
unbind outputs they may previously have bound.

Bumping versions in both client and server part of KWayland to support
this behaviour.

Reviewers: davidedmundson, graesslin

Reviewed By: graesslin

Subscribers: jgrulich, #frameworks

Tags: #frameworks

Maniphest Tasks: T7785

Differential Revision: https://phabricator.kde.org/D10929
2018-03-01 22:13:43 +03:00
Martin Flöser
43e71055d2 [server] Properly handle the situation when the DataSource for a drag gets destroyed
Summary:
This addresses the following situation:
1. Start drag on a QtWayland based window
2. Press escape
3. Release mouse

-> this results in a crash. The main reason for this is that QtWayland
destroys the DataSource in step 2 and KWayland did not expect this at
all. The drag and drop operation continued and results in step 3 in the
drag target to request data from the no longer existing DataSource.

This change addresses the root of the problem by cancelling the drag
operation when the DataSource gets destroyed.

BUG: 389221
FIXED-IN: 5.44

Test Plan:
New test case exposing the problem and manual testing with
kwin_wayland and dolphin (based on bug report)

Reviewers: #frameworks, #kwin, #plasma

Subscribers: plasma-devel

Tags: #frameworks, #plasma

Differential Revision: https://phabricator.kde.org/D10142
2018-02-25 14:14:58 +01:00
Martin Flöser
0d52ce8f9b [server] Don't crash when a subsurface gets commited whose parent surface got destroyed
Summary:
Qt seems to damage and commit child subsurfaces although their parent
got destroyed. This actually doesn't make any sense as without a parent
surface they cannot be shown. But nevertheless we should not crash in
such a situation.

This change guards the places in the commit handling code where the
parent gets accessed.

BUG: 389231

Test Plan: New test case which exposes the problem

Reviewers: #frameworks, #kwin, #plasma

Subscribers: plasma-devel

Tags: #plasma, #frameworks

Differential Revision: https://phabricator.kde.org/D10300
2018-02-07 19:41:58 +01:00
Roman Gilg
6d3e7691b5 Fix typo
Summary: Fix a typo

Reviewers: #plasma, davidedmundson

Reviewed By: #plasma, davidedmundson

Subscribers: plasma-devel, #frameworks

Tags: #frameworks, #plasma_on_wayland

Differential Revision: https://phabricator.kde.org/D10053
2018-01-23 17:26:13 +01:00
Laurent Montel
c829817117 Remove obsolete reviewboardrc file 2018-01-05 13:24:48 +01:00
David Edmundson
54e1eb103f Resolve some merge issues 2018-01-03 11:07:32 +00:00
David Edmundson
9ba84e0886 Unit test for Server Decoration Palette 2018-01-03 10:44:15 +00:00
David Edmundson
eb52e81eed Create interface for passing server decoration palettes
Summary:
It's kept separate in case we ever merge the server decoration manager
interface upstream, and this is too kwin specific to have in a
potentially shared spec.

Code is a copy+paste of existing boilerplate.

Replaces use of the deprecated qt extended surface.

I'd like to target 5.42 as otherwise we'll have a regression when we
release Plasma 5.12 as Qt's XDGv6 doesn't have a working qt extended
surface.

Test Plan: Attached unit test

Reviewers: #plasma, graesslin

Reviewed By: #plasma, graesslin

Subscribers: plasma-devel, #frameworks

Tags: #frameworks, #plasma

Differential Revision: https://phabricator.kde.org/D9599
2018-01-03 10:34:06 +00:00
David Edmundson
231dc9cba5 Explicitly include std::bind functions
Should fix compile
2018-01-02 10:18:38 +00:00
Martin Flöser
1a5762b9d7 [server] Add a method IdleInterface::simulateUserActivity
Summary:
So far only the client was able to simulate user activity. This new
method allows the server to also simulate user activity on all created
idle timeouts. This is required by KWin to prevent idle timeouts when
the user interacts through KDE Connect's virtual touchpad. In that
situation the mouse pointer is used without updating the input time
stamp as it doesn't come from "real" input devices and thus the idle
timeout prevention is not activated.

Reviewers: #frameworks, #plasma, #kwin

Subscribers: plasma-devel

Tags: #plasma_on_wayland, #frameworks

Differential Revision: https://phabricator.kde.org/D9510
2017-12-29 17:41:42 +01:00
Martin Flöser
e087a3666b Fix regression caused by backward compatibility support in data source
We should only enforce the check whether a data source has set the
actions for drag on drop on a selection if it's at least version 3. For
backward compatibility we used to set a default action which would
ensure that a version <3 and >3 client can interact with each other. But
due to that the action was set to a default value which breaks any
selection. Sorry about that.

This change ensures the backward compatibility behavior does not break
selection.

As the regression causes all clients to quit it is a severe regression
which requires fast action. Due to that I'm doing a maintainer push
without review. I encourage everyone to do a post commit review.

Sorry for not noticing the regression before. The backward compatibility
was the last thing I added in that patch set and apparently I did not
run all tests again.
2017-12-26 21:55:11 +01:00
Martin Flöser
072ad10b4b Fix @since version tags 2017-12-26 20:46:38 +01:00
Martin Flöser
42432a14fc Add support for version 3 of data device manager interface
Summary:
The main difference compared to version 2 is additional drag and drop
actions. The source and destination can negotiate whether the data
should be copied or moved or the user should be asked for either or.
This seems to be important for GTK, but is not yet implemented in Qt.

The main motivation for adding support is that it is required by SDL to
launch on Wayland.

BUG: 386993

Test Plan: Extended test case, sdl apps now start

Reviewers: #frameworks, #plasma, #kwin

Subscribers: plasma-devel

Tags: #plasma_on_wayland, #frameworks

Differential Revision: https://phabricator.kde.org/D9136
2017-12-26 20:41:43 +01:00
David Edmundson
e5631f0e7b Scope exported/imported objects to the test
Summary:
m_imported was parented to the TestForeign class, which lasts for all
the tests. This caused an error on teardown.

Test Plan: Ran with ASAN. Finally everything passes!

Reviewers: #plasma, graesslin

Reviewed By: #plasma, graesslin

Subscribers: plasma-devel, #frameworks

Tags: #frameworks, #plasma_on_wayland

Differential Revision: https://phabricator.kde.org/D9407
2017-12-19 15:56:10 +00:00
David Edmundson
d67ce1e86c Fix ASAN warning on TestXdgForeign
Summary:
Internally XdgForeign has some delete laters

If we clean up the connection immediately we delete them after we kill
the connection resulting in an error.

Kwin isn't going to tear down the connection in response to a resource
unbinding so we can just fix the test.

Test Plan:
Compiled with ASAN
Got further

Reviewers: #plasma, graesslin

Reviewed By: #plasma, graesslin

Subscribers: plasma-devel, #frameworks

Tags: #frameworks, #plasma

Differential Revision: https://phabricator.kde.org/D9406
2017-12-19 15:56:06 +00:00
David Edmundson
9251e894e4 Replace QCOMPARE(nullptr) with QVERIFY
QCOMPARE(T*, nullptr) apparently isn't valid on Qt5.7
2017-12-19 08:10:09 +00:00
David Edmundson
53a8a8e6be Fix error in WaylandSurface::testDisconnect
Summary:
This test deletes the client wayland connection.

We then finish the test and call test cleanup which
releases m_idleInhititManager.
Calling release after the connection is destroyed is an error.

Hence the explicit destroy.

Test Plan:
Built tests with ASAN
No more crash

Reviewers: #plasma, graesslin

Reviewed By: #plasma, graesslin

Subscribers: plasma-devel, #frameworks

Tags: #frameworks, #plasma

Differential Revision: https://phabricator.kde.org/D9402
2017-12-19 07:28:54 +00:00
David Edmundson
19ade014bc Explicit QCOMPARE(QString,QString)
Hopefully fix CI
2017-12-19 07:28:20 +00:00
David Edmundson
6a14023c36 Add explicit AppMenu protocol
Summary:
A protocol that attaches to a surface and contains two strings which can
change.

The intended use is for clients to link a DBus Appmenu object with a
surface.

This is in preparation for the Qt Extended Surface deprecation which
currently handles this in Kwin.

Test Plan: Attached unit test

Reviewers: #plasma, graesslin

Reviewed By: #plasma, graesslin

Subscribers: broulik, graesslin, plasma-devel, #frameworks

Tags: #frameworks, #plasma_on_wayland

Differential Revision: https://phabricator.kde.org/D8919
2017-12-18 22:08:31 +00:00
David Edmundson
20c53ee098 Fix ASAN warnings in XDGForeignV2Interface
Summary:
The current code captures a char* from a wayland event in a lambda.
By creating the QString first when we capture that by value we'll
implicitly shallow copy it.

The other issue was
someHash.erase(it);
*it->foo();

Even though where the iterator points to is still valid, the iterator
itself is an object that gets modified in erase which ASAN didn't like.

Test Plan:
Ran test.
Those particular errors went away
Tests passed

Subscribers: plasma-devel, #frameworks

Tags: #plasma_on_wayland, #frameworks

Differential Revision: https://phabricator.kde.org/D9319
2017-12-14 07:31:14 +00:00
Montel Laurent
b18f2b2d7a Fix exlude generated file from automoc feature 2017-12-14 07:49:03 +01:00
Christophe Giboudeaux
d4d32870e6 Fix testWaylandFullscreenShell.
Summary: This test needs the weston executable. Skip the test if the program wasn't found.

Reviewers: graesslin

Reviewed By: graesslin

Subscribers: plasma-devel, #frameworks

Tags: #plasma_on_wayland, #frameworks

Differential Revision: https://phabricator.kde.org/D8858
2017-11-27 17:23:58 +01:00
David Edmundson
ec75361d1f Expose wl_display_set_global_filter as a virtual method
Summary:
This allows a server to filter which globals are visible and bindable by
clients.

Design rationale:
Could be it's own class with Display as an arg, but we need the lifespan
to exactly match Display, and the cardinality to match Display and it
needs to be set after we're started but before clients connect.

Better to enfore rules with code than with documentation.

I'm filtering by interface name as there isn't any other good
identifier of what a wl_global refers to, even if you could assume
you can cast the userdata to a Server::Global.

Test Plan: Attached unit test

Reviewers: #plasma, graesslin, bcooksley

Reviewed By: #plasma, graesslin

Subscribers: bcooksley, graesslin, plasma-devel, #frameworks

Tags: #frameworks, #plasma

Differential Revision: https://phabricator.kde.org/D8050
2017-11-17 08:35:17 +00:00
Christophe Giboudeaux
6cf6a4c72c Fix kwayland-testXdgShellV6. 2017-11-16 23:27:52 +01:00
Martin Flöser
665c0535fe Add support for zwp_idle_inhibit_manager_v1
Summary:
This protocol allows to indicate that a wl_surface should inhibit idle
actions such as DPMS, screen locking if the surface is visible.

The protocol is quite simple: it just creates an IdleInhibitor for a
Surface. If such an IdleInhibitor exists the Surface is considered to
inhibit idle.

On the server side it is also exposed like that through the API. The
IdleInhibitorInterface is private to the library and only
SurfaceInterface is extended to expose whether it currently inhibits
idle.

CCBUG: 385956

Test Plan: New test case added

Reviewers: #frameworks, #kwin, #plasma_on_wayland

Subscribers: plasma-devel

Tags: #plasma_on_wayland, #frameworks

Differential Revision: https://phabricator.kde.org/D8396
2017-11-16 20:22:44 +01:00
Martin Flöser
f5cfe92b8a [server] Support inhibiting the IdleInterface
Summary:
This is a preparation step to support idle_inhibit_unstable_v1 protocol.
As in Plasma powermanagement, screen locking, dpms, etc. is not
controlled by the wayland compositor but by external components through
the IdleTimeout interface the compositor needs a way to inhibit the idle
timeouts. So once idle_inhibit_unstable_v1 is implemented the compositor
can hook this up to the inhibit API in IdleInterface and thus inhibit
powermanagement, etc. as requested by the idle_inhibit_unstable_v1
protocol.

The added API is straight forward:
 * inhibit: inhibits idle timeouts
 * uninhibit: uninhibits again
 * inhibit and uninhibit must be called in pairs, so twice inhibit,
means uninhibit must be called twice
 * isInhibited: whether it's inhibited
 * and a signal that it changed

The signal is mostly used internally to stop the timers.

Test Plan: Test case extended

Reviewers: #frameworks, #kwin, #plasma_on_wayland

Subscribers: plasma-devel

Tags: #plasma_on_wayland, #frameworks

Differential Revision: https://phabricator.kde.org/D8383
2017-11-14 17:44:14 +01:00
Marco Martin
7d53e7998c don't qcompare with nullptr
use QVERIFY(!pointer) instead, clang likes it more apparently
2017-10-13 12:08:47 +02:00
Marco Martin
9feb359676 Wayland foreign protocol
Summary:
Implement the "foreign" wayland protocol.
A client can export a surface with an unique string as handle,
then another client can refer to that surface and set an own surface as
child of that surface.
Potential use cases are out-of-process dialogs, such as file dialogs,
meant to be used by sandboxed processes that may not have the access
it needs to implement such dialogs.
The handle needs to be shared between the processes with other means,
such as dbus or command line paramenters.

The public api of the server side only tracks parent/child relationships as this is the only data kwin would need it for, the rest of the api is not exported so should be safer from eventual protocol changes

Test Plan:
the autotest works, but has a lot of random crashes when deleting surfaces,
unfortunately backtraces don't tell much and the crashes never occur when running into valgrind
behavior may still be wrong, depending on how the protocol is supposed
to work if more clients try to set the same exported surface as parent

Reviewers: #plasma, #kwin, davidedmundson, graesslin

Reviewed By: #plasma, #kwin, graesslin

Subscribers: davidedmundson, graesslin, plasma-devel, #frameworks

Tags: #frameworks, #plasma_on_wayland

Differential Revision: https://phabricator.kde.org/D7369
2017-10-13 11:30:13 +02:00
David Edmundson
4abf4183e0 Revert "Expose wl_display_set_global_filter as a virtual method"
This reverts commit 62b9960399.

We need to bump versions on CI first
2017-10-10 18:30:56 +02:00
David Edmundson
62b9960399 Expose wl_display_set_global_filter as a virtual method
Summary:
This allows a server to filter which globals are visible and bindable by
clients.

Design rationale:
Could be it's own class with Display as an arg, but we need the lifespan
to exactly match Display, and the cardinality to match Display and it
needs to be set after we're started but before clients connect.

Better to enfore rules with code than with documentation.

I'm filtering by interface name as there isn't any other good
identifier of what a wl_global refers to, even if you could assume
you can cast the userdata to a Server::Global.

Test Plan: Attached unit test

Reviewers: #plasma, graesslin

Reviewed By: #plasma, graesslin

Subscribers: graesslin, plasma-devel, #frameworks

Tags: #frameworks, #plasma

Differential Revision: https://phabricator.kde.org/D8050
2017-10-10 15:00:21 +02:00
David Edmundson
6b460f9a7f Only send OutputConfig sendApplied / sendFailed to the right resource
Summary:
I don't understand the original logic.
s_allResources contains /every/ resource, not just outputconfigurations.

Sending org_kde_kwin_outputconfiguration_send_applied to a wl_surface (for example),
results in an error.

The reason kwin doesn't currently crash is because we don't actually send
applied/failed after setting outputs. (which is another bug)

Test Plan: The existing unit test still passes.

Reviewers: #plasma, sebas

Reviewed By: #plasma, sebas

Subscribers: sebas, plasma-devel, #frameworks

Tags: #plasma_on_wayland, #frameworks

Differential Revision: https://phabricator.kde.org/D7898
2017-09-21 14:11:30 +01:00
David Edmundson
a1cfc8a5f3 Add missing command macro
Seems it was added whilst xdgv6 was in a branch
2017-09-21 12:52:21 +01:00
David Edmundson
01cace30dd Don't crash if a client (legally) uses deleted global contrast manager
Summary:
There is a race condition in the following situation:

    - Server creates a global
    - Client binds to that global (making a new resource for that
global)
    Simultaneously:
    - The client uses this resource
    - The server deletes the global

This was fixed for Blur, but as mention in that commit can also happen here.
Code is effectively a copy and paste from e8850b014c

Test Plan: Unit test. Booted normal session

Reviewers: #plasma

Subscribers: plasma-devel, #frameworks

Tags: #plasma_on_wayland, #frameworks

Differential Revision: https://phabricator.kde.org/D7885
2017-09-20 14:17:46 +01:00
David Edmundson
e8850b014c Don't crash if a client (legally) uses a deleted global
Summary:
There is a race condition in the following situation:

- Server creates a global
- Client binds to that global (making a new resource for that global)
Simultaneously:
- The client uses this resource
- The server deletes the global

We then process an event for a resource linked to a deleted global.

This is noted in the specification, the client documentation says:
"The object remains valid and requests to the object will be
ignored until the client destroys it, to avoid races between the global
going away and a client sending a request to it. "

KWayland does not handle this at all.

The global's user data refer to our C++ wrapper
The resource's user data refer to *the same* C++ wrapper

When the global is deleted the resource user data now refers to garbage.

To fix the issue, instead of setting the resource userdata to the
global, we set it to a smartpointer to the global stored on the heap.

We can then validate if our global is still valid.

Theoretically this applies to every global

Practically there are only 3 globals that don't have the lifespan of the
server. Output (which is read only and doesn't matter), Blur and
BackgroundContrast.

Blur resets it's global when a screen geometry changes.

Unfotunately this exactly at the same time that Plasmashell is
doing a lot of processing and creating some blurs.

Test Plan: See unit test

Reviewers: #plasma, graesslin

Reviewed By: #plasma, graesslin

Subscribers: graesslin, anthonyfieroni, plasma-devel, #frameworks

Tags: #frameworks, #plasma

Differential Revision: https://phabricator.kde.org/D7870
2017-09-19 13:50:16 +01:00
David Edmundson
9faa26330c Update @since docs 2017-09-08 12:31:37 +01:00
David Edmundson
f8198b50c8 Missing licenses 2017-09-04 17:21:15 +01:00
David Edmundson
3c67cc1399 Support XDG v6
Summary:

The main clever part that's not just boring boiler plate is how we
handle the structure change
A surface now has an XDGSurface which then has a an Xdg TopLevel or a
Xdg Popup

We need to fit this into the public API which assumes a surface has a
Surface or a Popup.
The old Surface is similar to the new TopLevel.

The shoehorning works by relying on the fact that a surface without a
role is pretty useless.

Clients create the surface implicitly with the toplevel or implicitly
with the popup.
The server only announced it has a new "XdgSurface" when it gets a new
zxdg_surface_get_toplevel.

----

Popup decisions:
- On popup creation the server should copy the current info from the
positioner and then it gets deleted. Given kwaylands job is to keep
state, we expose all these parameter via popup.

- Due to this positioner is not exposed as a resource anywhere.

- Server API is 100% backwards compatiable.
i.e new code will work identically with v5 clients.

- Client API is not.  Grabs are called separately from the constructor,
and the parent surface changed to an xdgsurface, not a raw surface.
V5 code still works as-is, just not with the new constructors.

It seemed better to match the v6 (and what will be the stable v7) than
to try and do hacks and lose functionality.
Given the client needs to change the code to opt into V6 anyway. I don't
think this is a huge problem.

Test Plan: Current test still passes.

Reviewers: #plasma, graesslin

Reviewed By: #plasma, graesslin

Subscribers: graesslin, mart, plasma-devel, #frameworks

Tags: #frameworks, #plasma_on_wayland

Differential Revision: https://phabricator.kde.org/D6047
2017-09-04 16:56:24 +01:00
David Edmundson
f1491e009e Treat input RGB buffers as premultiplied
Summary:
Currently the server treats incoming buffers as not premultiplied.

KWayland::Client sends data that is ARGB32 and ARGB32_Premultiplied as
the same
WL_SHM_FORMAT_ARGB8888.

According to a post on wayland-devel by Fredrik Höglund, all RGB data
should be treated as premultiplied, which matches what Qt is doing.

Client now performs a conversion rather than sending
mismatched data,

Note: This commit will still breaks a bunch of tests in
kwin as it compares the server output to a fixed
QImage with a format.

Test Plan:
Existing tests pass

Modified surface test to check the pixel data relative to the output
QImage format
not the input format (i.e both input from ARGB32 and
ARGB32_Premultiplied) should
both end up in a QImage with format Premultiplied with premultiplied
values.

The existing test was confirming that data was corrupted, checking that
even though
the output format was not pre-multiplied, the data was.

Reviewers: #plasma, graesslin

Reviewed By: #plasma, graesslin

Subscribers: plasma-devel, #frameworks

Tags: #plasma_on_wayland, #frameworks

Differential Revision: https://phabricator.kde.org/D7460
2017-08-30 09:58:36 +01:00
David Edmundson
9b564c4069 Update SurfaceInterface outputs when an output global gets destroyed
Summary:
As per existing TODO.

A new signal is added on Global to emit so we can process the result
whist we still have a valid object. The name is overly explicit to try
and logically separate it from QObject::destroyed().

Test Plan: Updated existing unit test.

Reviewers: #plasma, graesslin

Reviewed By: #plasma, graesslin

Subscribers: graesslin, anthonyfieroni, plasma-devel, #frameworks

Tags: #frameworks, #plasma_on_wayland

Differential Revision: https://phabricator.kde.org/D7531
2017-08-26 11:54:10 +01:00
David Edmundson
ec8887ad27 KWayland::Client::Surface track output destruction
Summary:
A compositor should send left events before deleting an output; however
if it doesn't, we don't want dangly pointers in our list of outputs on
the client surface.

Test Plan: Unit test

Reviewers: #plasma, graesslin

Reviewed By: #plasma, graesslin

Subscribers: plasma-devel, #frameworks

Tags: #plasma_on_wayland, #frameworks

Differential Revision: https://phabricator.kde.org/D7379
2017-08-18 15:14:36 +01:00
David Edmundson
eac4973697 Avoid sending data offers from an invalid source.
Summary:
A DataDevice will have a source when offers are available, but it can
also be legitimately cleared.

When calling DataDeviceInterface::sendSelection(DataDeviceInterface
*other) if the other data device has no source, we should be setting
that we also have no source.

In addition this also guards against Seat tracking a DataDeviceInterface
with no source when trying to sync x clipboards.

BUG: 383054

Reviewers: #plasma

Subscribers: graesslin, plasma-devel, #frameworks

Tags: #plasma_on_wayland, #frameworks

Differential Revision: https://phabricator.kde.org/D7316
2017-08-16 00:17:32 +01:00
David Faure
cac7d766b1 Make unittest independent from the location of the executable.
Summary:
This fixes the check in the unittest when doing
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/bin")
which I intend to do globally at some point.

Turns out it's comparing with its own executable location, so we
can use QCoreApplication to get it generically.

Test Plan: Verified to work with ctest and with "./testWaylandServerDisplay"

Reviewers: graesslin, mart

Reviewed By: graesslin, mart

Subscribers: plasma-devel, #frameworks

Tags: #plasma_on_wayland, #frameworks

Differential Revision: https://phabricator.kde.org/D6974
2017-07-30 01:05:45 +02:00
David Faure
0c42a1bfeb autotests: prepare for CMAKE_RUNTIME_OUTPUT_DIRECTORY being set
Scripted with
perl -pi -e 's/add_test\(([^ ]*) (.*?)\)/add_test(NAME $1 COMMAND $2)/' CMakeLists.txt
2017-07-29 08:27:59 +02:00
David Edmundson
e8ef0ea68f Destroy all kwayland objects created by registry when it is destroyed
Summary:
Currently one has to connect every object manually to connectionDied,
which is something we can do for them.

If the user also has a connection, the second will just no-op.

This fixes objects that linger longer than the QApp.

Reviewers: graesslin

Reviewed By: graesslin

Subscribers: graesslin, plasma-devel, #frameworks

Tags: #plasma_on_wayland, #frameworks

Differential Revision: https://phabricator.kde.org/D6727
2017-07-28 09:51:46 +01:00
Martin Flöser
c6b085f5eb [client] Track all created ConnectionThreads and add API to access them
Summary:
This is change needed by KWin. KWin has the problem that it destroys its
internal Wayland connection (KWin as client for KWin as server) before
shutting down the application. Other external libraries loaded into KWin
(e.g. breeze window decoration) are unloaded later on, then try to clean
up their Wayland resources and crash KWin due to accessing a no longer
valid Wayland connection.

With the help of this new API KWin can access all connections during
the clean up and destroy them before shutting down the Wayland server and
thus exit cleanly.

Reviewers: #frameworks, #plasma, #kwin

Subscribers: plasma-devel

Tags: #plasma_on_wayland, #frameworks

Differential Revision: https://phabricator.kde.org/D6569
2017-07-21 07:14:22 +02:00
Martin Flöser
dd873cb980 [server] Send text input leave if focused surface gets unbound
Summary: As 9266a94400 just for text input.

Test Plan: Adjusted test passes, fails without adjustment

Reviewers: #plasma, #frameworks

Subscribers: plasma-devel

Tags: #plasma_on_wayland, #frameworks

Differential Revision: https://phabricator.kde.org/D6786
2017-07-19 20:17:56 +02:00
Martin Flöser
1b989a0464 [server] Send pointer leave if focused surface gets unbound
Summary: As 9266a94400 just for pointer.

Reviewers: #plasma, #frameworks

Subscribers: plasma-devel

Tags: #plasma_on_wayland, #frameworks

Differential Revision: https://phabricator.kde.org/D6754
2017-07-19 07:13:18 +02:00
Martin Flöser
3db6bd64fe Drop unused variable 2017-07-17 17:03:40 +02:00
Martin Flöser
63102e1215 [client] Properly track enteredSurface in Keyboard
Summary:
ASAN found a heap-use-after-free when deleting the focused keyboard
surface in the client library. Keyboard did not track the lifetime of
the focused surface and thus one can access already freed memory.

Test Plan: Adjusted auto test to verify the variable gets cleared

Reviewers: #frameworks, #plasma

Subscribers: plasma-devel

Tags: #plasma_on_wayland, #frameworks

Differential Revision: https://phabricator.kde.org/D6741
2017-07-16 20:25:12 +02:00
Martin Flöser
9266a94400 [server] Send keyboard leave when client destroys the focused surface
Summary:
This is a change inspired by https://bugreports.qt.io/browse/QTBUG-61930.
When Qt closes a window due to a key press event it starts to repeat the
event as KWayland does not send a keyboard leave event. Weston on the
other hand does send out the keyboard leave. In my opinion it doesn't
make much sense to send out the keyboard leave in this situation and in
my opinion that is a client bug, but if it makes clients happy we can
send them the keyboard leave. Similar this should be done for pointer,
touch, etc.

BUG: 382280

Test Plan: Run the example added to the Qt bug and it worked fine

Reviewers: #frameworks, #plasma

Subscribers: plasma-devel

Tags: #plasma_on_wayland, #frameworks

Differential Revision: https://phabricator.kde.org/D6683
2017-07-16 16:25:25 +02:00