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
5619a293
Commit
5619a293
authored
Apr 04, 2021
by
Vlad Zahorodnii
Browse files
wayland: Send only current wl_output mode
parent
707c724d
Changes
1
Hide whitespace changes
Inline
Side-by-side
src/waylandoutput.cpp
View file @
5619a293
...
...
@@ -84,25 +84,13 @@ WaylandOutput::WaylandOutput(AbstractWaylandOutput *output, QObject *parent)
m_waylandOutput
->
setDpmsSupported
(
output
->
capabilities
()
&
AbstractWaylandOutput
::
Capability
::
Dpms
);
m_waylandOutput
->
setGlobalPosition
(
geometry
.
topLeft
());
m_waylandOutput
->
setScale
(
std
::
ceil
(
output
->
scale
()));
m_waylandOutput
->
setMode
(
output
->
modeSize
(),
output
->
refreshRate
());
m_xdgOutputV1
->
setName
(
output
->
name
());
m_xdgOutputV1
->
setDescription
(
output
->
description
());
m_xdgOutputV1
->
setLogicalPosition
(
geometry
.
topLeft
());
m_xdgOutputV1
->
setLogicalSize
(
geometry
.
size
());
const
auto
modes
=
output
->
modes
();
for
(
const
AbstractWaylandOutput
::
Mode
&
mode
:
modes
)
{
KWaylandServer
::
OutputInterface
::
ModeFlags
flags
;
if
(
mode
.
flags
&
AbstractWaylandOutput
::
ModeFlag
::
Current
)
{
flags
|=
KWaylandServer
::
OutputInterface
::
ModeFlag
::
Current
;
}
if
(
mode
.
flags
&
AbstractWaylandOutput
::
ModeFlag
::
Preferred
)
{
flags
|=
KWaylandServer
::
OutputInterface
::
ModeFlag
::
Preferred
;
}
m_waylandOutput
->
addMode
(
mode
.
size
,
flags
,
mode
.
refreshRate
);
}
m_waylandOutput
->
done
();
m_xdgOutputV1
->
done
();
...
...
@@ -138,7 +126,7 @@ void WaylandOutput::update()
m_waylandOutput
->
setGlobalPosition
(
geometry
.
topLeft
());
m_waylandOutput
->
setScale
(
std
::
ceil
(
m_platformOutput
->
scale
()));
m_waylandOutput
->
setTransform
(
kwinTransformToOutputTransform
(
m_platformOutput
->
transform
()));
m_waylandOutput
->
set
Current
Mode
(
m_platformOutput
->
modeSize
(),
m_platformOutput
->
refreshRate
());
m_waylandOutput
->
setMode
(
m_platformOutput
->
modeSize
(),
m_platformOutput
->
refreshRate
());
m_xdgOutputV1
->
setLogicalPosition
(
geometry
.
topLeft
());
m_xdgOutputV1
->
setLogicalSize
(
geometry
.
size
());
...
...
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