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
bafb03bd
Commit
bafb03bd
authored
Nov 26, 2014
by
Martin Flöser
Browse files
Drop global position from PointerInterface
No longer needed, not even as a convenience wrapper.
parent
d425515a
Changes
3
Hide whitespace changes
Inline
Side-by-side
src/wayland/autotests/client/test_wayland_seat.cpp
View file @
bafb03bd
...
...
@@ -326,7 +326,7 @@ void TestWaylandSeat::testPointer()
// test motion
m_seatInterface
->
setTimestamp
(
1
);
serverPointer
->
setGlobal
Pos
(
QPoint
(
10
,
16
));
m_seatInterface
->
setPointer
Pos
(
QPoint
(
10
,
16
));
QVERIFY
(
motionSpy
.
wait
());
QCOMPARE
(
motionSpy
.
first
().
first
().
toPoint
(),
QPoint
(
0
,
1
));
QCOMPARE
(
motionSpy
.
first
().
last
().
value
<
quint32
>
(),
quint32
(
1
));
...
...
src/wayland/pointer_interface.cpp
View file @
bafb03bd
...
...
@@ -73,7 +73,6 @@ PointerInterface::PointerInterface(SeatInterface *parent, wl_resource *parentRes
wl_fixed_from_double
(
pos
.
x
()),
wl_fixed_from_double
(
pos
.
y
()));
}
});
connect
(
parent
,
&
SeatInterface
::
pointerPosChanged
,
this
,
&
PointerInterface
::
globalPosChanged
);
}
PointerInterface
::~
PointerInterface
()
=
default
;
...
...
@@ -104,12 +103,6 @@ void PointerInterface::setFocusedSurface(SurfaceInterface *surface, quint32 seri
wl_fixed_from_double
(
pos
.
x
()),
wl_fixed_from_double
(
pos
.
y
()));
}
void
PointerInterface
::
setGlobalPos
(
const
QPointF
&
pos
)
{
Q_D
();
d
->
seat
->
setPointerPos
(
pos
);
}
void
PointerInterface
::
buttonPressed
(
quint32
button
,
quint32
serial
)
{
Q_D
();
...
...
@@ -151,12 +144,6 @@ void PointerInterface::Private::releaseCallback(wl_client *client, wl_resource *
unbind
(
resource
);
}
QPointF
PointerInterface
::
globalPos
()
const
{
Q_D
();
return
d
->
seat
->
pointerPos
();
}
PointerInterface
::
Private
*
PointerInterface
::
d_func
()
const
{
return
reinterpret_cast
<
Private
*>
(
d
.
data
());
...
...
src/wayland/pointer_interface.h
View file @
bafb03bd
...
...
@@ -35,28 +35,9 @@ class SurfaceInterface;
class
KWAYLANDSERVER_EXPORT
PointerInterface
:
public
Resource
{
Q_OBJECT
Q_PROPERTY
(
QPointF
globalPos
READ
globalPos
WRITE
setGlobalPos
NOTIFY
globalPosChanged
)
public:
virtual
~
PointerInterface
();
/**
* Convenient method to set the pointer position of the SeatInterface.
* @see SeatInterface::setPointerPos
**/
void
setGlobalPos
(
const
QPointF
&
pos
);
/**
* Convenient method to get the pointer position of the SeatInterface.
* @see SeatInterface::pointerPos
**/
QPointF
globalPos
()
const
;
Q_SIGNALS:
/**
* Convenient signal emitted when the SeatInterface's pointer position changes.
* @see SeatInterface::pointerPosChanged
**/
void
globalPosChanged
(
const
QPointF
&
pos
);
private:
void
setFocusedSurface
(
SurfaceInterface
*
surface
,
quint32
serial
);
SurfaceInterface
*
focusedSurface
()
const
;
...
...
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