Skip to content
Merged
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
1 change: 1 addition & 0 deletions changelog/next.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,3 +5,4 @@
- Fixed mpris players returning `rate` for `minRate` and `maxRate`.
- Fixed missing/wrong change signals on various properties.
- Fixed session lock crashes on sleep, wake, DPMS, and unlocking.
- QsWindow.updatesEnabled makes sure windows are redrawn when set to true.
4 changes: 4 additions & 0 deletions src/window/proxywindow.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -495,6 +495,10 @@ void ProxyWindowBase::setUpdatesEnabled(bool updatesEnabled) {

if (this->window != nullptr) {
QQuickWindowPrivate::get(this->window)->updatesEnabled = updatesEnabled;

// The render loop discards expose and update requests while updates are disabled,
// which can leave the surface without a valid buffer. Render a frame to recover.
if (updatesEnabled) this->window->update();
}

emit this->updatesEnabledChanged();
Expand Down
3 changes: 3 additions & 0 deletions src/window/windowinterface.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -148,6 +148,9 @@ class WindowInterface: public Reloadable {
/// When set to false, the window will not re-render in response to animations
/// or other visual updates from other windows. This is useful for static windows
/// such as wallpapers that do not need to update frequently, saving GPU cycles.
///
/// When set back to true, a new frame is rendered, including any changes made
/// while updates were disabled.
Q_PROPERTY(bool updatesEnabled READ updatesEnabled WRITE setUpdatesEnabled NOTIFY updatesEnabledChanged);
Q_PROPERTY(QQmlListProperty<QObject> data READ data);
// clang-format on
Expand Down
Loading