Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Plasma
KWin
Commits
e81e9506
Commit
e81e9506
authored
Oct 20, 2020
by
Aleix Pol Gonzalez
🐧
Browse files
xwl: simplify logic of boolean function
parent
6ec13c41
Changes
1
Hide whitespace changes
Inline
Side-by-side
xwl/clipboard.cpp
View file @
e81e9506
...
...
@@ -66,7 +66,7 @@ Clipboard::Clipboard(xcb_atom_t atom, QObject *parent)
void
Clipboard
::
wlSelectionChanged
(
KWaylandServer
::
AbstractDataSource
*
dsi
)
{
if
(
dsi
&&
!
ownsSelection
(
dsi
))
{
if
(
!
ownsSelection
(
dsi
))
{
// Wayland native client provides new selection
if
(
!
m_checkConnection
)
{
m_checkConnection
=
connect
(
workspace
(),
&
Workspace
::
clientActivated
,
...
...
@@ -80,7 +80,7 @@ void Clipboard::wlSelectionChanged(KWaylandServer::AbstractDataSource *dsi)
bool
Clipboard
::
ownsSelection
(
KWaylandServer
::
AbstractDataSource
*
dsi
)
const
{
return
dsi
->
client
()
==
DataBridge
::
self
()
->
dataDeviceIface
()
->
client
();
return
dsi
&&
dsi
->
client
()
==
DataBridge
::
self
()
->
dataDeviceIface
()
->
client
();
}
void
Clipboard
::
checkWlSource
()
...
...
@@ -173,7 +173,7 @@ void Clipboard::x11OffersChanged(const QStringList &added, const QStringList &re
}
}
else
{
KWaylandServer
::
AbstractDataSource
*
currentSelection
=
waylandServer
()
->
seat
()
->
selection
();
if
(
currentSelection
&&
!
ownsSelection
(
currentSelection
))
{
if
(
!
ownsSelection
(
currentSelection
))
{
waylandServer
()
->
seat
()
->
setSelection
(
nullptr
);
}
}
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment