forcefully activate popup windows when they open
AbandonedPublic

Authored by mart on Feb 16 2018, 6:10 PM.

Details

Reviewers
None
Group Reviewers
Plasma
Summary

if an applet is requiresattention, always give the popup focus

rationale is for the devicenotifier which opten opens and is not possible to
dismiss it by clicking anywhere: unfortunately the only way we have is to
give it focus, so it can close.

there is probably a more elegant way to do this (and not steal focus)
maybe a dbus protocol from kwin?

Test Plan

device notifier always gets focus even if input from the current focus
window is recent

Diff Detail

Repository
R242 Plasma Framework (Library)
Branch
phab/activatepopups
Lint
No Linters Available
Unit
No Unit Test Coverage
mart created this revision.Feb 16 2018, 6:10 PM
Restricted Application added projects: Plasma, Frameworks. · View Herald TranscriptFeb 16 2018, 6:10 PM
Restricted Application added subscribers: Frameworks, plasma-devel. · View Herald Transcript
mart requested review of this revision.Feb 16 2018, 6:10 PM

What would this code do if the device notifier is expanded but on the desktop?

mart added a comment.Feb 19 2018, 1:31 PM

What would this code do if the device notifier is expanded but on the desktop?

giving desktop window focus, which means we should also either check window flags or the applet formfactor... (tough i would still like a smarter solution)

mart added a comment.Feb 19 2018, 2:14 PM

another way, may be adding a default kwin rule or script which lets every plasma window go trough

If we were to do this, we need to first make Device Notifier not freak out when you have a wonky USB cable.

mart added a comment.Feb 21 2018, 7:08 PM

An alternate idea:

  • we open it without giging focus
  • the current show time is 5 seconds
  • after 2 seconds (1 would be enough?) we check if there was user activity with kidletime
  • if there was activity, if the notifier doesn't contain the cursor or isn't focused, then close it
  • otherwise the usual 5 seconds
mart abandoned this revision.Mar 8 2018, 10:13 AM