Improve single-instance application behavior
ClosedPublic

Authored by volkov on May 8 2018, 4:00 PM.

Details

Summary
  1. Avoid showing the window of the second instance by creating KDBusService object before creating the window object.
  2. Activate the window on the second start.

Diff Detail

Repository
R102 KInfoCenter
Branch
master
Lint
No Linters Available
Unit
No Unit Test Coverage
volkov created this revision.May 8 2018, 4:00 PM
Restricted Application added a project: Plasma. · View Herald TranscriptMay 8 2018, 4:00 PM
Restricted Application added a subscriber: plasma-devel. · View Herald Transcript
volkov requested review of this revision.May 8 2018, 4:00 PM
mart added a subscriber: mart.May 11 2018, 9:37 AM
mart added inline comments.
main.cpp
71

KWindowSystem::forceActiveWindow should never be used by normal applications, it's reserved for workspaces and won't work on Wayland.
QWidget::activateWindow should be enough, even if that's not guaranteed to actually raise the window, is more correct.

This comment was removed by volkov.
main.cpp
71
mart accepted this revision.May 16 2018, 10:18 AM
This revision is now accepted and ready to land.May 16 2018, 10:18 AM
volkov closed this revision.May 21 2018, 2:28 PM