RFC: [StatusBarSpaceInfo] Only update when window is active
AbandonedPublic

Authored by broulik on Sep 14 2018, 1:41 PM.

Details

Reviewers
elvisangelaccio
sitter
Group Reviewers
Dolphin
Summary

Avoids needlessly waking up the disk or network when the window isn't active.

CCBUG: 398612

Test Plan

Verified that it updates once it gets focus
Verified the timer stops when window doesn't have focus

Has the side-effect that when you have multiple windows visible at the same time (e.g. two windows next to each other) that only the active one will update its free space info live

Creating a MountPointObserver will eventually query KMountPoint which statvfs the file system and potentially block. So, perhaps this should be changed to not destroy but just tell it to "not update"? or have a refcount for "active listeners" as well? oof..

Even pressing Alt+Tab causes the window briefly to lose focus (X doing a short grab), so this needs some further work

Also doesn't do anything wrt tabs, if you have multiple tabs open, all of them still update, even when not current

Diff Detail

Repository
R318 Dolphin
Lint
Lint Skipped
Unit
Unit Tests Skipped
broulik created this revision.Sep 14 2018, 1:41 PM
Restricted Application added a project: Dolphin. · View Herald TranscriptSep 14 2018, 1:41 PM
Restricted Application added a subscriber: kfm-devel. · View Herald Transcript
broulik requested review of this revision.Sep 14 2018, 1:41 PM
broulik edited the test plan for this revision. (Show Details)
broulik retitled this revision from [StatusBarSpaceInfo] Only update when window is active to RFC: [StatusBarSpaceInfo] Only update when window is active.Sep 14 2018, 2:04 PM
broulik edited the test plan for this revision. (Show Details)
broulik edited the test plan for this revision. (Show Details)Sep 14 2018, 2:36 PM

+1 for D15507 and D15508

I'm not sure about this one. Even if the window is inactive, it could be still "visible" to the user's eyes. Why should it show stale information then?

https://doc.qt.io/qt-5/qwidget.html#visibleRegion would be more reliable and also work for not visible tabs I think.

That said, I am not sure how that behaves for semi-transparent windows, so Elvis' point probably stands. A conservative approach might be to only stop polling when minimized? Then the window is definitely not visible.

https://doc.qt.io/qt-5/qwidget.html#visibleRegion would be more reliable and also work for not visible tabs I think.

Good idea, will try. It won't help with "obscured" windows, though, but yeah, the minimize state is probably definitely something to take into account (though I hardly ever minimize windows, they're just buried under 20 layers of windows here :D)

broulik abandoned this revision.Apr 23 2019, 12:09 PM