Don't exit when running in gui mode and notification times out
ClosedPublic

Authored by davidre on May 6 2019, 6:51 PM.

Details

Summary

If a screenshot is taken in DBus or background mode and the running instance is 'upgraded' to gui mode while the notification is displaying the instance would still exit after the notification timed out or was destroyed. So simply check if we are running in gui mode before exiting.

Test Plan
  1. Take a screenshot via shortcut without opening Spectacle
  2. While the notifcation displays open Spectacle for example via shortcut (don't run the binary directly)
  3. Spectacle doesn't exit when the notifcation times out or is closed

Diff Detail

Repository
R166 Spectacle
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.
davidre created this revision.May 6 2019, 6:51 PM
Restricted Application added a project: Spectacle. · View Herald TranscriptMay 6 2019, 6:51 PM
Restricted Application added a subscriber: Spectacle. · View Herald Transcript
davidre requested review of this revision.May 6 2019, 6:51 PM
ngraham retitled this revision from Don't exit when running in gui mode and notification times out If a screenshot is taken in DBus or background mode and the running instance is 'upgraded' to gui mode while the notication is displaying the instance would still exit after the... to Don't exit when running in gui mode and notification times out.May 6 2019, 6:51 PM
ngraham edited the summary of this revision. (Show Details)
davidre retitled this revision from Don't exit when running in gui mode and notification times out to Don't exit when running in gui mode and notification times out .May 6 2019, 6:51 PM
davidre edited the summary of this revision. (Show Details)
davidre edited the summary of this revision. (Show Details)May 6 2019, 6:57 PM

I know this isn't the most elegant way but I didn't want to introduce a new class member that is updated in DbusStartAgent or make notify a member to disconnect from.

davidre edited the test plan for this revision. (Show Details)May 13 2019, 11:15 AM
davidre edited the test plan for this revision. (Show Details)
ngraham accepted this revision.May 15 2019, 4:07 AM
ngraham added a subscriber: ngraham.

LGTM, good enough!

This revision is now accepted and ready to land.May 15 2019, 4:07 AM

I don't have commit access so actually you would have to do that for me ;)

This comment was removed by ngraham.
This revision was automatically updated to reflect the committed changes.