Bug 347486 - don't grab keyboard focus by default by korgac dialog, improve position save/restore add size
Summary: don't grab keyboard focus by default by korgac dialog, improve position save/...
Status: RESOLVED FIXED
Alias: None
Product: korgac
Classification: Applications
Component: general (show other bugs)
Version: 4.13.2
Platform: Debian unstable Linux
: NOR major
Target Milestone: ---
Assignee: kdepim bugs
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2015-05-09 19:59 UTC by David Fries
Modified: 2018-10-26 05:25 UTC (History)
3 users (show)

See Also:
Latest Commit:
Version Fixed In:


Attachments
patches for no grab, show reminder window, smaller dialog, save size and position fixes (18.15 KB, patch)
2015-05-09 20:01 UTC, David Fries
Details

Note You need to log in before you can comment on or make changes to this bug.
Description David Fries 2015-05-09 19:59:21 UTC
While it can make it easier to dismiss (if it grabs focus through the activateWindow call), it also means if you are typing and a reminder comes in it will both get those keystrokes and a space or return will dismiss the reminder before you have a chance to ever see what the reminder was about, which assumes you are even looking at your screen to see the reminder box flash up, if you are typing from paper you might not even know.

This patch will call raiseWindow instead of activateWindow, but adds a dock menu item to grab focus if someone actually wants that behavior.

While I was add it I added a dock menu item to show the reminder window, which was useful in debugging, and lets you get at items that have been suspended, alloing to view or dismiss them.  This might satisfy "Bug 302865 - Inaccessible reminders"

There is a code comment "Try to keep the dialog small and non-obtrusive." I've made it smaller by default, and set the minimum size even smaller than reasonable, but this is better than the previous which wouldn't let you size it smaller than the default.

I added more points to save the position and improve the logic, now it will save and restore the position and size, and then show the window so it will no longer jump.

Patch is against Debian 4.14.1 source tree.  The korgac in the previous Debian release, 4.4.11 does not grab the keyboard when the notification dialog appears.

Reproducible: Always

Steps to Reproduce:
1. set korganizer reminder
2. start typing a paragraph
3. continue typing as the notification goes off

Actual Results:  
watch korgac reminder appear grab keyboard focus and vanish at the next space, depending on the timing you have no chance to stop typing before it is gone

Expected Results:  
The notifier window to appear at the last location it was dismissed at and only get focus when the window manager directs focus to it.

I'm flagging the severity at major, because it was so disruptive I had stopped using it until I fixed it.
Comment 1 David Fries 2015-05-09 20:01:48 UTC
Created attachment 92515 [details]
patches for no grab, show reminder window, smaller dialog, save size and position fixes

see the main bug description
Comment 2 Laurent Montel 2015-05-10 06:57:03 UTC
Please use reviewboard for it.
It's easier to comment patch.
I can't comment here.
Comment 3 Laurent Montel 2018-10-26 05:25:52 UTC
Git commit 709d5c4eb9c81436c4b33e13756ff7750d95fa2b by Laurent Montel.
Committed on 26/10/2018 at 05:24.
Pushed by mlaurent into branch 'master'.

Patch from David Fries

Summary

Instead of saving position sometimes (application close, suspend
reminder), save at each point the dialog hides, dismiss reminder,
dismiss all, escape or window close, etc.

In addition to saving the position, save the geometry to get the size
as well, that way if the user wants it bigger (or smaller) the only
have to do it once.

The logic was show, move, which would run in that order, the window
shows, then it moves to the correct location which looks bad, restore
the position & size, then show, so it appears in the final location.
Test Plan

A quicker way to test this is with a previous patch "Show Reminders" dock menu item option, as opposed to setting a bunch of reminders and waiting for them to go off.

before patch is applied/after patch is applied behaviors

    move the Reminder window to a corner of the screen, show the Reminder window [ before/after it will appear at the same location]
    move the Reminder window to a different corner, press escape, show the Reminder window [ before the escape position didn't save and it appears in the previous location, after it appears in the escape position]
    make the Reminders window large, show Reminders window [ before/after it is the large size]
    exit korgac, run korgac, show Reminders window [ before it is back to the previous normal size, after it is the larger size]

Reviewers: mlaurent, dvratil

Reviewed By: dvratil

Subscribers: dvratil, kde-pim

Tags: #kde_pim

Differential Revision: https://phabricator.kde.org/D16245

M  +26   -11   korgac/alarmdialog.cpp
M  +2    -1    korgac/alarmdialog.h

https://commits.kde.org/korganizer/709d5c4eb9c81436c4b33e13756ff7750d95fa2b