Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
10
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Open sidebar
Plasma
KWin
Commits
8add14fe
Commit
8add14fe
authored
Aug 20, 2015
by
Martin Flöser
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[wayland] Drop hack for faking input for Qt popups
This reverts
29c2ae57
.
parent
28b48e69
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
0 additions
and
40 deletions
+0
-40
main_wayland.cpp
main_wayland.cpp
+0
-1
wayland_server.cpp
wayland_server.cpp
+0
-35
wayland_server.h
wayland_server.h
+0
-4
No files found.
main_wayland.cpp
View file @
8add14fe
...
...
@@ -206,7 +206,6 @@ void ApplicationWayland::continueStartupWithX()
Xcb
::
sync
();
// Trigger possible errors, there's still a chance to abort
notifyKSplash
();
waylandServer
()
->
createDummyQtWindow
();
}
void
ApplicationWayland
::
createX11Connection
()
...
...
wayland_server.cpp
View file @
8add14fe
...
...
@@ -115,10 +115,6 @@ void WaylandServer::init(const QByteArray &socketName)
}
if
(
surface
->
client
()
==
m_internalConnection
.
server
)
{
// one of Qt's windows
if
(
m_dummyWindowSurface
&&
(
m_dummyWindowSurface
->
id
()
==
surface
->
surface
()
->
id
()))
{
fakeDummyQtWindowInput
();
return
;
}
// HACK: in order to get Qt to not block for frame rendered, we immediatelly emit the
// frameRendered once we get a new damage event.
auto
s
=
surface
->
surface
();
...
...
@@ -310,37 +306,6 @@ void WaylandServer::removeClient(ShellClient *c)
emit
shellClientRemoved
(
c
);
}
void
WaylandServer
::
createDummyQtWindow
()
{
if
(
m_dummyWindow
)
{
return
;
}
m_dummyWindow
.
reset
(
new
QWindow
());
m_dummyWindow
->
setSurfaceType
(
QSurface
::
RasterSurface
);
m_dummyWindow
->
show
();
m_dummyWindowSurface
=
KWayland
::
Client
::
Surface
::
fromWindow
(
m_dummyWindow
.
data
());
}
void
WaylandServer
::
fakeDummyQtWindowInput
()
{
// we need to fake Qt into believing it has got any seat events
// this is done only when receiving either a key press or button.
// we simulate by sending a button press and release
auto
surface
=
KWayland
::
Server
::
SurfaceInterface
::
get
(
m_dummyWindowSurface
->
id
(),
m_internalConnection
.
server
);
if
(
!
surface
)
{
return
;
}
const
auto
oldSeatSurface
=
m_seat
->
focusedPointerSurface
();
const
auto
oldPos
=
m_seat
->
focusedPointerSurfacePosition
();
m_seat
->
setFocusedPointerSurface
(
surface
,
QPoint
(
0
,
0
));
m_seat
->
setPointerPos
(
QPointF
(
0
,
0
));
m_seat
->
pointerButtonPressed
(
Qt
::
LeftButton
);
m_seat
->
pointerButtonReleased
(
Qt
::
LeftButton
);
m_internalConnection
.
server
->
flush
();
m_dummyWindow
->
hide
();
m_seat
->
setFocusedPointerSurface
(
oldSeatSurface
,
oldPos
);
}
void
WaylandServer
::
dispatch
()
{
if
(
!
m_display
)
{
...
...
wayland_server.h
View file @
8add14fe
...
...
@@ -109,7 +109,6 @@ public:
int
createInputMethodConnection
();
void
createInternalConnection
();
void
createDummyQtWindow
();
void
initWorkspace
();
KWayland
::
Server
::
ClientConnection
*
xWaylandConnection
()
const
{
...
...
@@ -138,7 +137,6 @@ Q_SIGNALS:
void
shellClientRemoved
(
ShellClient
*
);
private:
void
fakeDummyQtWindowInput
();
quint16
createClientId
(
KWayland
::
Server
::
ClientConnection
*
c
);
KWayland
::
Server
::
Display
*
m_display
=
nullptr
;
KWayland
::
Server
::
CompositorInterface
*
m_compositor
=
nullptr
;
...
...
@@ -160,8 +158,6 @@ private:
AbstractBackend
*
m_backend
=
nullptr
;
QList
<
ShellClient
*>
m_clients
;
QList
<
ShellClient
*>
m_internalClients
;
QScopedPointer
<
QWindow
>
m_dummyWindow
;
KWayland
::
Client
::
Surface
*
m_dummyWindowSurface
=
nullptr
;
QHash
<
KWayland
::
Server
::
ClientConnection
*
,
quint16
>
m_clientIds
;
KWIN_SINGLETON
(
WaylandServer
)
};
...
...
Write
Preview
Markdown
is supported
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