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
54bbfde2
Commit
54bbfde2
authored
May 04, 2022
by
Vlad Zahorodnii
Browse files
Make SurfaceItemX11 schedule a repaint if the shape changes
parent
94d30c22
Changes
2
Hide whitespace changes
Inline
Side-by-side
src/surfaceitem_x11.cpp
View file @
54bbfde2
...
...
@@ -18,7 +18,7 @@ SurfaceItemX11::SurfaceItemX11(Window *window, Item *parent)
connect
(
window
,
&
Window
::
bufferGeometryChanged
,
this
,
&
SurfaceItemX11
::
handleBufferGeometryChanged
);
connect
(
window
,
&
Window
::
geometryShapeChanged
,
this
,
&
SurfaceItemX11
::
discardQuads
);
this
,
&
SurfaceItemX11
::
handleGeometryShapeChanged
);
m_damageHandle
=
xcb_generate_id
(
kwinApp
()
->
x11Connection
());
xcb_damage_create
(
kwinApp
()
->
x11Connection
(),
m_damageHandle
,
window
->
frameId
(),
...
...
@@ -123,6 +123,12 @@ void SurfaceItemX11::handleBufferGeometryChanged(Window *window, const QRect &ol
setSize
(
window
->
bufferGeometry
().
size
());
}
void
SurfaceItemX11
::
handleGeometryShapeChanged
()
{
scheduleRepaint
(
boundingRect
());
discardQuads
();
}
QRegion
SurfaceItemX11
::
shape
()
const
{
const
QRect
clipRect
=
window
()
->
clientGeometry
().
translated
(
-
window
()
->
bufferGeometry
().
topLeft
());
...
...
src/surfaceitem_x11.h
View file @
54bbfde2
...
...
@@ -37,6 +37,7 @@ public:
private
Q_SLOTS
:
void
handleBufferGeometryChanged
(
Window
*
window
,
const
QRect
&
old
);
void
handleGeometryShapeChanged
();
protected:
SurfacePixmap
*
createPixmap
()
override
;
...
...
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