Skip to content
GitLab
Menu
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
79951125
Commit
79951125
authored
Feb 05, 2021
by
Vlad Zahorodnii
Browse files
Change type of opacity to qreal
The rest of code assumes that it's qreal.
parent
e117caa3
Changes
6
Hide whitespace changes
Inline
Side-by-side
internal_client.cpp
View file @
79951125
...
...
@@ -149,12 +149,12 @@ NET::WindowType InternalClient::windowType(bool direct, int supported_types) con
return
m_windowType
;
}
double
InternalClient
::
opacity
()
const
qreal
InternalClient
::
opacity
()
const
{
return
m_opacity
;
}
void
InternalClient
::
setOpacity
(
double
opacity
)
void
InternalClient
::
setOpacity
(
qreal
opacity
)
{
if
(
m_opacity
==
opacity
)
{
return
;
...
...
internal_client.h
View file @
79951125
...
...
@@ -35,8 +35,8 @@ public:
QSize
maxSize
()
const
override
;
QRect
transparentRect
()
const
override
;
NET
::
WindowType
windowType
(
bool
direct
=
false
,
int
supported_types
=
0
)
const
override
;
double
opacity
()
const
override
;
void
setOpacity
(
double
opacity
)
override
;
qreal
opacity
()
const
override
;
void
setOpacity
(
qreal
opacity
)
override
;
void
killWindow
()
override
;
bool
isPopupWindow
()
const
override
;
QByteArray
windowRole
()
const
override
;
...
...
@@ -88,7 +88,7 @@ private:
QWindow
*
m_internalWindow
=
nullptr
;
QString
m_captionNormal
;
QString
m_captionSuffix
;
double
m_opacity
=
1.0
;
qreal
m_opacity
=
1.0
;
NET
::
WindowType
m_windowType
=
NET
::
Normal
;
Qt
::
WindowFlags
m_internalWindowFlags
=
Qt
::
WindowFlags
();
bool
m_userNoBorder
=
false
;
...
...
toplevel.cpp
View file @
79951125
...
...
@@ -247,7 +247,7 @@ bool Toplevel::resourceMatch(const Toplevel *c1, const Toplevel *c2)
return
c1
->
resourceClass
()
==
c2
->
resourceClass
();
}
double
Toplevel
::
opacity
()
const
qreal
Toplevel
::
opacity
()
const
{
if
(
!
info
)
{
return
1.0
;
...
...
@@ -257,13 +257,13 @@ double Toplevel::opacity() const
return
info
->
opacity
()
*
1.0
/
0xffffffff
;
}
void
Toplevel
::
setOpacity
(
double
new_opacity
)
void
Toplevel
::
setOpacity
(
qreal
new_opacity
)
{
if
(
!
info
)
{
return
;
}
double
old_opacity
=
opacity
();
qreal
old_opacity
=
opacity
();
new_opacity
=
qBound
(
0.0
,
new_opacity
,
1.0
);
if
(
old_opacity
==
new_opacity
)
return
;
...
...
toplevel.h
View file @
79951125
...
...
@@ -448,8 +448,8 @@ public:
xcb_visualid_t
visual
()
const
;
bool
shape
()
const
;
QRegion
inputShape
()
const
;
virtual
void
setOpacity
(
double
opacity
);
virtual
double
opacity
()
const
;
virtual
void
setOpacity
(
qreal
opacity
);
virtual
qreal
opacity
()
const
;
int
depth
()
const
;
bool
hasAlpha
()
const
;
virtual
bool
setupCompositing
();
...
...
waylandclient.cpp
View file @
79951125
...
...
@@ -107,12 +107,12 @@ bool WaylandClient::isLocalhost() const
return
true
;
}
double
WaylandClient
::
opacity
()
const
qreal
WaylandClient
::
opacity
()
const
{
return
m_opacity
;
}
void
WaylandClient
::
setOpacity
(
double
opacity
)
void
WaylandClient
::
setOpacity
(
qreal
opacity
)
{
const
qreal
newOpacity
=
qBound
(
0.0
,
opacity
,
1.0
);
if
(
newOpacity
==
m_opacity
)
{
...
...
waylandclient.h
View file @
79951125
...
...
@@ -34,8 +34,8 @@ public:
pid_t
pid
()
const
override
;
bool
isLockScreen
()
const
override
;
bool
isLocalhost
()
const
override
;
double
opacity
()
const
override
;
void
setOpacity
(
double
opacity
)
override
;
qreal
opacity
()
const
override
;
void
setOpacity
(
qreal
opacity
)
override
;
AbstractClient
*
findModal
(
bool
allow_itself
=
false
)
override
;
void
resizeWithChecks
(
const
QSize
&
size
,
ForceGeometry_t
force
=
NormalGeometrySet
)
override
;
void
setFrameGeometry
(
const
QRect
&
rect
,
ForceGeometry_t
force
=
NormalGeometrySet
)
override
;
...
...
@@ -81,7 +81,7 @@ private:
QString
m_captionNormal
;
QString
m_captionSuffix
;
double
m_opacity
=
1.0
;
qreal
m_opacity
=
1.0
;
QRect
m_requestedFrameGeometry
;
QRect
m_bufferGeometry
;
QRect
m_requestedClientGeometry
;
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a 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