Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
7
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Open sidebar
Plasma
KWin
Commits
1e2f2a28
Commit
1e2f2a28
authored
Nov 17, 2020
by
David Edmundson
Committed by
Vlad Zahorodnii
Dec 09, 2020
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Port to kwayland-server socket changes
parent
9799456f
Changes
6
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
22 additions
and
10 deletions
+22
-10
autotests/integration/no_xdg_runtime_dir_test.cpp
autotests/integration/no_xdg_runtime_dir_test.cpp
+1
-2
main_wayland.cpp
main_wayland.cpp
+1
-1
plugins/platforms/wayland/wayland_output.cpp
plugins/platforms/wayland/wayland_output.cpp
+1
-1
plugins/platforms/x11/windowed/x11windowed_backend.cpp
plugins/platforms/x11/windowed/x11windowed_backend.cpp
+1
-1
wayland_server.cpp
wayland_server.cpp
+12
-5
wayland_server.h
wayland_server.h
+6
-0
No files found.
autotests/integration/no_xdg_runtime_dir_test.cpp
View file @
1e2f2a28
...
...
@@ -29,8 +29,7 @@ void NoXdgRuntimeDirTest::initTestCase()
void
NoXdgRuntimeDirTest
::
testInitFails
()
{
// this test verifies that without an XDG_RUNTIME_DIR the WaylandServer fails to start
QVERIFY
(
waylandServer
()
->
init
(
s_socketName
.
toLocal8Bit
()));
QVERIFY
(
!
waylandServer
()
->
start
());
QVERIFY
(
!
waylandServer
()
->
init
(
s_socketName
.
toLocal8Bit
()));
}
WAYLANDTEST_MAIN
(
NoXdgRuntimeDirTest
)
...
...
main_wayland.cpp
View file @
1e2f2a28
...
...
@@ -696,7 +696,7 @@ int main(int argc, char * argv[])
a
.
platform
()
->
setInitialOutputCount
(
outputCount
);
QObject
::
connect
(
&
a
,
&
KWin
::
Application
::
workspaceCreated
,
server
,
&
KWin
::
WaylandServer
::
initWorkspace
);
environment
.
insert
(
QStringLiteral
(
"WAYLAND_DISPLAY"
),
server
->
display
()
->
socketName
());
environment
.
insert
(
QStringLiteral
(
"WAYLAND_DISPLAY"
),
server
->
socketName
());
a
.
setProcessStartupEnvironment
(
environment
);
a
.
setStartXwayland
(
parser
.
isSet
(
xwaylandOption
));
a
.
setApplicationsToStart
(
parser
.
positionalArguments
());
...
...
plugins/platforms/wayland/wayland_output.cpp
View file @
1e2f2a28
...
...
@@ -121,7 +121,7 @@ void XdgShellOutput::updateWindowTitle()
grab
=
i18n
(
"Press right control key to grab pointer"
);
}
const
QString
title
=
i18nc
(
"Title of nested KWin Wayland with Wayland socket identifier as argument"
,
"KDE Wayland Compositor #%1 (%2)"
,
m_number
,
waylandServer
()
->
display
()
->
socketName
());
"KDE Wayland Compositor #%1 (%2)"
,
m_number
,
waylandServer
()
->
socketName
());
if
(
grab
.
isEmpty
())
{
m_xdgShellSurface
->
setTitle
(
title
);
...
...
plugins/platforms/x11/windowed/x11windowed_backend.cpp
View file @
1e2f2a28
...
...
@@ -348,7 +348,7 @@ void X11WindowedBackend::updateWindowTitle()
{
const
QString
grab
=
m_keyboardGrabbed
?
i18n
(
"Press right control to ungrab input"
)
:
i18n
(
"Press right control key to grab input"
);
const
QString
title
=
QStringLiteral
(
"%1 (%2) - %3"
).
arg
(
i18n
(
"KDE Wayland Compositor"
))
.
arg
(
waylandServer
()
->
display
()
->
socketName
())
.
arg
(
waylandServer
()
->
socketName
())
.
arg
(
grab
);
for
(
auto
it
=
m_outputs
.
constBegin
();
it
!=
m_outputs
.
constEnd
();
++
it
)
{
(
*
it
)
->
setWindowTitle
(
title
);
...
...
wayland_server.cpp
View file @
1e2f2a28
...
...
@@ -331,10 +331,8 @@ bool WaylandServer::init(const QByteArray &socketName, InitializationFlags flags
{
m_initFlags
=
flags
;
m_display
=
new
KWinDisplay
(
this
);
if
(
!
socketName
.
isNull
()
&&
!
socketName
.
isEmpty
())
{
m_display
->
setSocketName
(
QString
::
fromUtf8
(
socketName
));
}
else
{
m_display
->
setAutomaticSocketNaming
(
true
);
if
(
!
m_display
->
addSocketName
(
QString
::
fromUtf8
(
socketName
)))
{
return
false
;
}
m_compositor
=
m_display
->
createCompositor
(
m_display
);
connect
(
m_compositor
,
&
CompositorInterface
::
surfaceCreated
,
this
,
...
...
@@ -744,7 +742,7 @@ void WaylandServer::dispatch()
if
(
m_internalConnection
.
server
)
{
m_internalConnection
.
server
->
flush
();
}
m_display
->
dispatchEvents
(
0
);
m_display
->
dispatchEvents
();
}
static
AbstractClient
*
findClientInList
(
const
QList
<
AbstractClient
*>
&
clients
,
KWaylandServer
::
SurfaceInterface
*
surface
)
...
...
@@ -827,4 +825,13 @@ bool WaylandServer::isKeyboardShortcutsInhibited() const
return
false
;
}
QString
WaylandServer
::
socketName
()
const
{
const
QStringList
socketNames
=
display
()
->
socketNames
();
if
(
!
socketNames
.
isEmpty
())
{
return
socketNames
.
first
();
}
return
QString
();
}
}
wayland_server.h
View file @
1e2f2a28
...
...
@@ -241,6 +241,12 @@ public:
AbstractWaylandOutput
*
findOutput
(
KWaylandServer
::
OutputInterface
*
output
)
const
;
/**
* Returns the first socket name that can be used to connect to this server.
* For a full list, use display()->socketNames()
*/
QString
socketName
()
const
;
Q_SIGNALS:
void
shellClientAdded
(
KWin
::
AbstractClient
*
);
void
shellClientRemoved
(
KWin
::
AbstractClient
*
);
...
...
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