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
9641aa42
Commit
9641aa42
authored
Dec 16, 2020
by
Aleix Pol Gonzalez
🐧
Browse files
tablet: small cleanups
Add missing & Remove unnecessary namespace Consistant m_ prefix
parent
03fc51ef
Changes
1
Hide whitespace changes
Inline
Side-by-side
src/wayland/tablet_v2_interface.cpp
View file @
9641aa42
...
...
@@ -20,7 +20,7 @@ static int s_version = 1;
class
TabletV2InterfacePrivate
:
public
QtWaylandServer
::
zwp_tablet_v2
{
public:
TabletV2InterfacePrivate
(
TabletV2Interface
*
q
,
uint32_t
vendorId
,
uint32_t
productId
,
const
QString
name
,
const
QStringList
&
paths
)
TabletV2InterfacePrivate
(
TabletV2Interface
*
q
,
uint32_t
vendorId
,
uint32_t
productId
,
const
QString
&
name
,
const
QStringList
&
paths
)
:
zwp_tablet_v2
()
,
q
(
q
)
,
m_vendorId
(
vendorId
)
...
...
@@ -33,14 +33,14 @@ public:
wl_resource
*
resourceForSurface
(
SurfaceInterface
*
surface
)
const
{
ClientConnection
*
client
=
surface
->
client
();
QtWaylandServer
::
zwp_tablet_v2
::
Resource
*
r
=
resourceMap
().
value
(
*
client
);
Resource
*
r
=
resourceMap
().
value
(
*
client
);
return
r
?
r
->
handle
:
nullptr
;
}
void
zwp_tablet_v2_destroy_resource
(
QtWaylandServer
::
zwp_tablet_v2
::
Resource
*
resource
)
override
{
Q_UNUSED
(
resource
);
if
(
removed
&&
resourceMap
().
isEmpty
())
{
if
(
m_
removed
&&
resourceMap
().
isEmpty
())
{
delete
q
;
}
}
...
...
@@ -50,7 +50,7 @@ public:
const
uint32_t
m_productId
;
const
QString
m_name
;
const
QStringList
m_paths
;
bool
removed
=
false
;
bool
m_
removed
=
false
;
};
TabletV2Interface
::
TabletV2Interface
(
uint32_t
vendorId
,
uint32_t
productId
,
...
...
@@ -70,7 +70,7 @@ bool TabletV2Interface::isSurfaceSupported(SurfaceInterface *surface) const
void
TabletV2Interface
::
sendRemoved
()
{
d
->
removed
=
true
;
d
->
m_
removed
=
true
;
for
(
QtWaylandServer
::
zwp_tablet_v2
::
Resource
*
resource
:
d
->
resourceMap
())
{
d
->
send_removed
(
resource
->
handle
);
}
...
...
@@ -83,12 +83,14 @@ public:
void
update
(
quint32
serial
,
SurfaceInterface
*
surface
,
const
QPoint
&
hotspot
)
{
const
bool
diff
=
m_serial
!=
serial
&&
m_surface
!=
surface
&&
m_hotspot
!=
hotspot
;
m_serial
=
serial
;
m_surface
=
surface
;
m_hotspot
=
hotspot
;
if
(
diff
)
const
bool
diff
=
m_serial
!=
serial
||
m_surface
!=
surface
||
m_hotspot
!=
hotspot
;
if
(
diff
)
{
m_serial
=
serial
;
m_surface
=
surface
;
m_hotspot
=
hotspot
;
Q_EMIT
q
->
changed
();
}
}
TabletCursorV2
*
const
q
;
...
...
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