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
a8883c35
Commit
a8883c35
authored
Oct 29, 2020
by
David Edmundson
Browse files
Don't use Qt::UniqueConnection on a lambda
It won't detect properly, instead the same code is moved into a member function.
parent
74c1b0f3
Changes
2
Hide whitespace changes
Inline
Side-by-side
src/wayland/surface_interface.cpp
View file @
a8883c35
...
...
@@ -313,20 +313,7 @@ void SurfaceInterfacePrivate::surface_attach(Resource *resource, struct ::wl_res
return
;
}
pending
.
buffer
=
BufferInterface
::
get
(
compositor
->
display
(),
buffer
);
QObject
::
connect
(
pending
.
buffer
,
&
BufferInterface
::
aboutToBeDestroyed
,
q
,
[
this
](
BufferInterface
*
buffer
)
{
if
(
pending
.
buffer
==
buffer
)
{
pending
.
buffer
=
nullptr
;
}
if
(
cached
.
buffer
==
buffer
)
{
cached
.
buffer
=
nullptr
;
}
if
(
current
.
buffer
==
buffer
)
{
current
.
buffer
->
unref
();
current
.
buffer
=
nullptr
;
}
},
Qt
::
UniqueConnection
);
QObject
::
connect
(
pending
.
buffer
,
&
BufferInterface
::
aboutToBeDestroyed
,
q
,
&
SurfaceInterface
::
handleBufferRemoved
,
Qt
::
UniqueConnection
);
}
void
SurfaceInterfacePrivate
::
surface_damage
(
Resource
*
,
int32_t
x
,
int32_t
y
,
int32_t
width
,
int32_t
height
)
...
...
@@ -1011,4 +998,18 @@ QMatrix4x4 SurfaceInterface::surfaceToBufferMatrix() const
return
d
->
surfaceToBufferMatrix
;
}
void
SurfaceInterface
::
handleBufferRemoved
(
BufferInterface
*
buffer
)
{
if
(
d
->
pending
.
buffer
==
buffer
)
{
d
->
pending
.
buffer
=
nullptr
;
}
if
(
d
->
cached
.
buffer
==
buffer
)
{
d
->
cached
.
buffer
=
nullptr
;
}
if
(
d
->
current
.
buffer
==
buffer
)
{
d
->
current
.
buffer
->
unref
();
d
->
current
.
buffer
=
nullptr
;
}
}
}
// namespace KWaylandServer
src/wayland/surface_interface.h
View file @
a8883c35
...
...
@@ -480,6 +480,8 @@ Q_SIGNALS:
void
committed
();
private:
void
handleBufferRemoved
(
BufferInterface
*
buffer
);
QScopedPointer
<
SurfaceInterfacePrivate
>
d
;
friend
class
SurfaceInterfacePrivate
;
};
...
...
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