Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 21 additions & 0 deletions src/core/lockscreen.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,13 @@
#include "interfaces/lockscreeninterface.h"
#include "output/output.h"
#include "seat/helper.h"
#include "utils/cmdline.h"

Check warning on line 9 in src/core/lockscreen.cpp

View workflow job for this annotation

GitHub Actions / cppcheck

Include file: "utils/cmdline.h" not found.
#include "common/treelandlogging.h"

Check warning on line 10 in src/core/lockscreen.cpp

View workflow job for this annotation

GitHub Actions / cppcheck

Include file: "common/treelandlogging.h" not found.
#include "greeter/greeterproxy.h"

Check warning on line 11 in src/core/lockscreen.cpp

View workflow job for this annotation

GitHub Actions / cppcheck

Include file: "greeter/greeterproxy.h" not found.
#include <woutputrenderwindow.h>

Check warning on line 12 in src/core/lockscreen.cpp

View workflow job for this annotation

GitHub Actions / cppcheck

Include file: <woutputrenderwindow.h> not found. Please note: Cppcheck does not need standard library headers to get proper results.

#ifdef EXT_SESSION_LOCK_V1
#include <wsessionlock.h>

Check warning on line 15 in src/core/lockscreen.cpp

View workflow job for this annotation

GitHub Actions / cppcheck

Include file: <wsessionlock.h> not found. Please note: Cppcheck does not need standard library headers to get proper results.
#include <wsessionlocksurface.h>

#include "rootsurfacecontainer.h"
Expand Down Expand Up @@ -96,6 +97,26 @@
Q_ASSERT(ok);
#endif

connect(output->output(), &WOutput::enabledChanged, this, [this, output]() {
if (!output->output()->isEnabled() || !isLocked()) {
return;
}
#if EXT_SESSION_LOCK_V1
auto outputItem = output->outputItem();
if (outputItem) {
auto *lockSurface = m_lockSurfaces[outputItem].get();
if (lockSurface) {
lockSurface->configureSize(outputItem->size().toSize());
}
}
#endif
auto it = m_components.find(output);
if (it != m_components.end() && it->second) {
it->second->setSize(output->outputItem()->size());
}
Helper::instance()->window()->update();
});

if (!m_impl) {
return;
}
Expand Down
20 changes: 20 additions & 0 deletions src/seat/helper.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -936,9 +936,23 @@ void Helper::onSetOutputPowerMode(wlr_output_power_v1_set_mode_event *event)
if (output->handle()->enabled) {
return;
}
if (!output->handle()->current_mode) {
auto mode = output->preferred_mode();
if (mode) {
newState.set_mode(mode);
}
}
auto outputObj = getOutput(WOutput::fromHandle(output));
if (outputObj) {
newState.set_scale(outputObj->preferredScaleFactor(output->handle()->width > 0
? QSize(output->handle()->width, output->handle()->height)
: QSize()));
}
newState.set_enabled(true);
if (!output->commit_state(newState)) {
qCCritical(lcTlCore, "commit failed on output %s", output->handle()->name);
} else {
output->schedule_frame();
}
break;
}
Expand Down Expand Up @@ -2773,6 +2787,12 @@ void Helper::onPrepareForSleep(bool sleep)
} else {
qCInfo(lcTlCore) << "Re-enabled rendering after hibernate";
enableRender();
for (auto o : std::as_const(m_outputList)) {
if (o && o->output() && o->output()->isEnabled()) {
o->output()->scheduleFrame();
}
}
m_renderWindow->update();
}
}

Expand Down
Loading