Bug 356461 - Notification Settings wrong default display for notifications and notifaction position.
Summary: Notification Settings wrong default display for notifications and notifaction...
Status: RESOLVED FIXED
Alias: None
Product: plasmashell
Classification: Plasma
Component: Notifications (show other bugs)
Version: 5.5.0
Platform: Arch Linux Linux
: NOR normal
Target Milestone: 1.0
Assignee: Martin Klapetek
URL:
Keywords:
: 356977 (view as bug list)
Depends on:
Blocks:
 
Reported: 2015-12-10 11:46 UTC by Artur O.
Modified: 2020-10-27 03:47 UTC (History)
12 users (show)

See Also:
Latest Commit:
Version Fixed In:


Attachments
picture of notification settings and display settings. (1.09 MB, image/png)
2015-12-10 11:47 UTC, Artur O.
Details
picture of notification when default position is used. (618.78 KB, image/jpeg)
2015-12-10 11:56 UTC, Artur O.
Details
picture of notification when topright position is used. (3.43 MB, image/jpeg)
2015-12-10 12:02 UTC, Artur O.
Details
picture of notification when middletop position is used. (3.44 MB, image/jpeg)
2015-12-10 12:04 UTC, Artur O.
Details
picture of notification when middlebottom position is used. (3.43 MB, image/jpeg)
2015-12-10 12:05 UTC, Artur O.
Details
Debug patch (1.15 KB, patch)
2015-12-14 15:58 UTC, Martin Klapetek
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Artur O. 2015-12-10 11:46:02 UTC
I have 3 monitors Left{res: 1080x1920, rotation: portrait} Middle{res: 1920x1080, rotation: landscape, primary} Right{res: 1920x1080, rotation: landscape}

However since the 5.5.0 update the notifications are a mess. Default position try to center it on the whole virtual display it seems because they end up in the bottom part of my middle display.

Going to Notification Settings:
1: The display is shown as portrait when my primary is landscape. (IE its getting 0x0 display that is _not_ primary. (Screenshot 1)

2: Setting the notification in the corners (topright, topleft, bottomleft, bottomright) seems to position the notification on the _primary display_ (this case landscape) in appropriate corners even though the issue described in 1 above.

3: Setting the notification in the middle (middletop, middlebottom) seems to position notifications _on my left monitor_ where top/bottom is relative to top/bottom on my primary display. (Screenshot 2/3)

4: Setting no custom position seems to position the notifications on the monitor to the left of the current monitor my mouse is located if there is a monitor.
Other words: 
mouse on monitor Left positions the notification on monitor Left.
mouse on monitor Middle positions the notification on monitor Left.
mouse on monitor Right positions the notification on monitor middle.

Reproducible: Always
Comment 1 Artur O. 2015-12-10 11:47:46 UTC
Created attachment 95968 [details]
picture of notification settings and display settings.

This shows the Notification Settings having the portrait monitor (0x0) as template for settings instead of my primary monitor.
Comment 2 Artur O. 2015-12-10 11:56:07 UTC
Created attachment 95969 [details]
picture of notification when default position is used.

Um about the position of the notification and relative to mouse. It now seems that it's random. Sometimes it fires up on left sometimes on middle no matter where the mouse is!
Comment 3 Artur O. 2015-12-10 12:02:39 UTC
Created attachment 95970 [details]
picture of notification when topright position is used.

Correct position of what I want but seems wrong that it shows portrait monitor when its my primary landscape.
Comment 4 Artur O. 2015-12-10 12:04:36 UTC
Created attachment 95971 [details]
picture of notification when middletop position is used.
Comment 5 Artur O. 2015-12-10 12:05:25 UTC
Created attachment 95972 [details]
picture of notification when middlebottom position is used.
Comment 6 Martin Klapetek 2015-12-10 21:30:15 UTC
Git commit 5d56df0d53851a8cd61344d356bcb552220dd3ed by Martin Klapetek.
Committed on 10/12/2015 at 21:29.
Pushed by mklapetek into branch 'Plasma/5.5'.

[notifications] Fix default notification position setting

It can happen that the onAppletLocationChanged() slot gets called before
init(), making init() reset the calculated position from the slot.

M  +5    -2    applets/notifications/lib/notificationsapplet.cpp

http://commits.kde.org/plasma-workspace/5d56df0d53851a8cd61344d356bcb552220dd3ed
Comment 7 Björn Bidar (Thaodan) 2015-12-13 16:04:43 UTC
Is this patch inclued in 5.5? Cause the notification is still on the wrong screen.
Comment 8 Artur O. 2015-12-13 16:23:18 UTC
(In reply to Thaodan from comment #7)
> Is this patch inclued in 5.5? Cause the notification is still on the wrong
> screen.

This happend after 5.5 release so don't think so.
Comment 9 Björn Bidar (Thaodan) 2015-12-13 16:59:42 UTC
Would it be possible to backport the patch to 5.5?
Comment 10 David Edmundson 2015-12-13 17:04:17 UTC
It is backported to the 5.5 branch, it is not in 5.5.0
it will be in 5.5.1
Comment 11 Martin Klapetek 2015-12-14 15:58:01 UTC
Created attachment 96065 [details]
Debug patch

Is anyone with any multi-screen setup able to test simple patches?

I'm just interested in some debug output of how the notifications
applet chooses the screen it puts the notifications on. So if you can
apply patches, please try this attached one, apply to plasma-workspace,
rebuild (just applets/notifications is enough), install over the system
one, run "kquitapp5 plasmashell" and then just "plasmashell" from
Konsole and post the output starting with "-->" these.

Also please state what's your multiscreen setup.
Comment 12 Daniel Boles 2015-12-15 20:11:16 UTC
possibly related to wider scale mis-selection of screen as documented in https://bugs.kde.org/show_bug.cgi?id=346181

I might be able to test your patch within the next couple of days once the rest of my newly migrated Debian testing installation is stable (relatively speaking).
Comment 13 Martin Klapetek 2015-12-15 20:59:21 UTC
Perhaps, although the notifications applet has in addition its
own code to select the screen where to put the popups.

What it does is that it takes the screen information from Plasma,
looks for a system screen that matches the one received from
Plasma and then it intersects that screen with your "work area",
that is the screen available space without panels.

But this is good for a single setup only, because as soon as you
add a screen that has a different resolution, the work area will
be the "bounding box", ie. the outer rectangle containing all
of your screens, so the screen with the smaller resolution will
have an empty space appended at its bottom part.

This becomes rather bad with setups like Artur's (if you look at
his screenshots), because with the screen being in vertical mode,
there's a lots of empty spaced attached to the other screens. So
ideally I'd like to switch away from work area altogether, but it's
hard to do so because I have just a single (laptop) screen, so I need
someone to test patches.
Comment 14 Artur O. 2015-12-15 23:29:31 UTC
(In reply to Martin Klapetek from comment #13)
> Perhaps, although the notifications applet has in addition its
> own code to select the screen where to put the popups.
> 
> What it does is that it takes the screen information from Plasma,
> looks for a system screen that matches the one received from
> Plasma and then it intersects that screen with your "work area",
> that is the screen available space without panels.
> 
> But this is good for a single setup only, because as soon as you
> add a screen that has a different resolution, the work area will
> be the "bounding box", ie. the outer rectangle containing all
> of your screens, so the screen with the smaller resolution will
> have an empty space appended at its bottom part.
> 
> This becomes rather bad with setups like Artur's (if you look at
> his screenshots), because with the screen being in vertical mode,
> there's a lots of empty spaced attached to the other screens. So
> ideally I'd like to switch away from work area altogether, but it's
> hard to do so because I have just a single (laptop) screen, so I need
> someone to test patches.

Tried to find a git package in aur but for some reason plasma-desktop-git does not contain the notification applet. However the 5.5.1 just went live on arch. 

Atm default position seems to be a bit random. Mostly it displays on the bottom lower right corner of the working display (middle/primary). Spamming notify send it sometimes just shows up on my left monitor in the middle.
Comment 15 auxsvr 2015-12-16 15:04:08 UTC
After updating to 5.5.1, the notifications appear mostly on the lower left and occasionally on the right corner of a single-monitor desktop. Before the update, I had no such problem.
Comment 16 Martin Klapetek 2015-12-16 16:28:48 UTC
> for some reason plasma-desktop-git does not contain the notification applet

It's part of plasma-workspace.

---

@auxsvr - what if you force the position to bottom-right in the applet settings?
I'll review the code once again for possible mistakes.
Comment 17 Artur O. 2015-12-16 16:33:56 UTC
(In reply to Martin Klapetek from comment #16)
> > for some reason plasma-desktop-git does not contain the notification applet
> 
> It's part of plasma-workspace.

Um for some reason the arch pkg is named plasma-desktop but it's plasma-workspace.
https://aur.archlinux.org/packages/plasma-desktop-git/
Comment 18 Nick Cross 2015-12-16 16:40:53 UTC
@Martin Klapetek : I am seeing this on Fedora 23 , fully updated (although without this update which is still in testing : https://bodhi.fedoraproject.org/updates/FEDORA-2015-f0aa62dc50 ).

I can easily reproduce it by calling "notify-send test" from the command line - the popup appears on the left, not the right.
Comment 19 Martin Klapetek 2015-12-16 17:02:23 UTC
What if you force the position to bottom-right in the applet settings?
Comment 20 Nick Cross 2015-12-16 18:38:17 UTC
I can't see any settings for location. Popups are not movable to a location as far as I can see. And notify-send does not provide anything for that.
Comment 21 Martin Klapetek 2015-12-16 18:40:44 UTC
Right-click the applet in your panel -> Notifications settings... -> Use custom position for the notifications popups.
Comment 22 Nick Cross 2015-12-16 18:46:38 UTC
*Interesting* - never knew that was there ;-)

Ok I am at home not at work so this is testing in a single laptop configuration. Previously the popups would appear on the left hand side of the laptop screen rather than right. Custom selecting the right hand side does indeed make them appear in the correct place. Bizarrely deselecting custom location - they still now appear on the right hand side.
Comment 23 Raghavendra kamath 2015-12-17 06:17:32 UTC
For me setting the custom location in notification solves thew problem and this setting now persists after reboot unlike earlier. I am on arch and can say this now works as intended
Comment 24 Artur O. 2015-12-17 08:08:00 UTC
(In reply to Raghavendra kamath from comment #23)
> For me setting the custom location in notification solves thew problem and
> this setting now persists after reboot unlike earlier. I am on arch and can
> say this now works as intended

This bug report is about the default position not custom position.
Comment 25 auxsvr 2015-12-17 08:35:30 UTC
I still have the problem with the incorrect placement of the notifications even after forcing them to display on the lower right corner of the desktop (by the way, I had already done this before and refreshed the setting). Most notifications now appear on the right, but the ones from the nm plasmoid mostly appear on the left.
Comment 26 Martin Klapetek 2015-12-17 16:29:55 UTC
I'm refactoring the whole positioning thing, stay tuned.
Comment 27 Daniel Boles 2015-12-17 16:33:20 UTC
Hi,

Will that also cover these problems with various panel popups appearing on the wrong screen (in a random location) or not at all? https://bugs.kde.org/show_bug.cgi?id=346181

Thanks!
Comment 28 Martin Klapetek 2015-12-17 16:38:28 UTC
No, that's a whole different thing.

Btw. I could still really really use the output from the patch in comment #11.
Comment 29 Martin Klapetek 2015-12-17 21:47:10 UTC
Patch up at https://git.reviewboard.kde.org/r/126408/ if anybody
wants to give it a try. That would help a lot if someone else could
test it.
Comment 30 Artur O. 2015-12-19 02:25:08 UTC
(In reply to Martin Klapetek from comment #29)
> Patch up at https://git.reviewboard.kde.org/r/126408/ if anybody
> wants to give it a try. That would help a lot if someone else could
> test it.

I tried your patch on workspace-git. Default position now seems to be top-right of where the notification widget is located (primary desktop for me, middle). 

Spammed also the notifications with a simple for loop and notify send and they seem stable.

Downgraded back to 1.5.1 and did the same, had to redo "unchecked custom position" that for some reason was checked, but doing the for loop the notifications came at different positions and even size. 

Summa summarum: I think the patch works (fixes default to top-right, and stable notifications) at least for me and my "odd" setup. 

Thanks for your work Martin, and happy holidays!

For anyone else wanting to try this patch and is running arch, try this pkgbuild https://gist.github.com/CommanderAlchemy/69eb96b5624a889bdea0 (drop in replacement for current plasma-workspace).
Comment 31 Martin Klapetek 2015-12-21 03:35:03 UTC
*** Bug 356977 has been marked as a duplicate of this bug. ***
Comment 32 Martin Klapetek 2016-01-05 04:54:49 UTC
Git commit 0c6b354b7e22297544f1d37608d6fdcd777c4d52 by Martin Klapetek.
Committed on 05/01/2016 at 04:52.
Pushed by mklapetek into branch 'Plasma/5.5'.

[notifications] Refactor the screen handling code

This patch does this:
* moves the screen handling code from the import into
the applet baseclass, which can access the containment
available screen rect and watch for screen changes

* fixes the applet config dialog's custom screen position
setting which has a bug of always being enabled

* consolidates duplicated code in the helper import
into functions

* ensures that popups have correct positions when on
screen that does not start with y=0 (and x=0 in some
cases too)

REVIEW: 126408
Related: bug 353966

M  +1    -0    applets/notifications/lib/CMakeLists.txt
M  +69   -25   applets/notifications/lib/notificationsapplet.cpp
M  +15   -2    applets/notifications/lib/notificationsapplet.h
M  +7    -1    applets/notifications/package/contents/ui/Notifications.qml
M  +1    -1    applets/notifications/package/contents/ui/configNotifications.qml
M  +2    -3    applets/notifications/plugin/CMakeLists.txt
M  +57   -55   applets/notifications/plugin/notificationshelper.cpp
M  +4    -2    applets/notifications/plugin/notificationshelper.h

http://commits.kde.org/plasma-workspace/0c6b354b7e22297544f1d37608d6fdcd777c4d52
Comment 33 Thiago Sueto 2020-10-27 03:47:50 UTC
I'm guessing the commit did not autoclose this bug report?
I'm setting this as RESOLVED/FIXED if it's alright, given there was no answer after the patch and that (AFAIK) there were major changes to the notifications in recent years.

If this is still reproducible, please file a new bug report.