on xenial help sign in
Don't show any power dialogs while the screen is off
commite0e0217cdac1c6911283e1655dccb45e05245433 authorMichael Terry <michael.terry@canonical.com> dateWed 14 Jan 2015, 10:33 (12 years ago) parent202e068
1 file changed+10−1
qml/Shell.qml+10−1
qml/Shell.qml+10−1
@@ -181,7 +181,16 @@ Item {
181181 WindowKeysFilter {
182182 Keys.onPressed: {
183183 if (event.key == Qt.Key_PowerOff || event.key == Qt.Key_PowerDown) {
184− dialogs.onPowerKeyPressed();
184+ // FIXME: We only consider power key presses if the screen is
185+ // on because of bug 1410830. The theory is that when that bug
186+ // is encountered, there is a >2s delay between the power press
187+ // event and the power release event, which causes the shutdown
188+ // dialog to appear on resume. So to avoid that symptom while
189+ // we investigate the root cause, we simply won't initiate any
190+ // dialogs when the screen is off.
191+ if (Powerd.status === Powerd.On) {
192+ dialogs.onPowerKeyPressed();
193+ }
185194 event.accepted = true;
186195 } else {
187196 volumeKeyFilter.onKeyPressed(event.key);