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
a62a8213
Commit
a62a8213
authored
Oct 29, 2020
by
Vlad Zahorodnii
Browse files
wayland: Port kwin to new DragAndDropIcon type
The DragAndDropIcon type encapsulates the icon surface and its position.
parent
94389de8
Changes
1
Hide whitespace changes
Inline
Side-by-side
pointer_input.cpp
View file @
a62a8213
...
...
@@ -968,8 +968,8 @@ void CursorImage::markAsRendered()
if
(
m_currentSource
==
CursorSource
::
DragAndDrop
)
{
// always sending a frame rendered to the drag icon surface to not freeze QtWayland (see https://bugreports.qt.io/browse/QTBUG-51599 )
if
(
auto
ddi
=
waylandServer
()
->
seat
()
->
dragSource
())
{
if
(
auto
s
=
ddi
->
icon
())
{
s
->
frameRendered
(
m_surfaceRenderedTimer
.
elapsed
());
if
(
const
KWaylandServer
::
DragAndDropIcon
*
icon
=
ddi
->
icon
())
{
icon
->
surface
()
->
frameRendered
(
m_surfaceRenderedTimer
.
elapsed
());
}
}
auto
p
=
waylandServer
()
->
seat
()
->
dragPointer
();
...
...
@@ -1152,11 +1152,11 @@ void CursorImage::updateDragCursor()
const
bool
needsEmit
=
m_currentSource
==
CursorSource
::
DragAndDrop
;
QImage
additionalIcon
;
if
(
auto
ddi
=
waylandServer
()
->
seat
()
->
dragSource
())
{
if
(
auto
dragIcon
=
ddi
->
icon
())
{
if
(
auto
buffer
=
dragIcon
->
buffer
())
{
if
(
const
KWaylandServer
::
DragAndDropIcon
*
dragIcon
=
ddi
->
icon
())
{
if
(
KWaylandServer
::
BufferInterface
*
buffer
=
dragIcon
->
surface
()
->
buffer
())
{
additionalIcon
=
buffer
->
data
().
copy
();
additionalIcon
.
setDevicePixelRatio
(
dragIcon
->
bufferScale
());
additionalIcon
.
setOffset
(
dragIcon
->
offset
());
additionalIcon
.
setDevicePixelRatio
(
dragIcon
->
surface
()
->
bufferScale
());
additionalIcon
.
setOffset
(
dragIcon
->
position
());
}
}
}
...
...
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