mirror of
https://github.com/quickshell-mirror/quickshell.git
synced 2026-10-27 02:54:36 +00:00
core/window: render a frame when re-enabling updatesEnabled
This commit is contained in:
1 parent
897fcdaa99
commit
68c2c85c33
3 files changed
+8
No files matched your search
@@ -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.
|
||||
@@ -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();
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in new issue
Block a user