After a deep investigation and many many experiments, my conclusion is that the actual version (without my patch) seems to work well, with only one exception: the bottom-right notification that appears the first in a session shows misplaced (too down in the screen). However, subsequent notifications appears correctly.
Therefore, it seems that the problem is not in the width or height calculation, but in the Y position the first time the library needs to show a notification.
The notifications that appears in the top of the screen (update-notifier or rhythmbox) don't seem to have this problem.
After a deep investigation and many many experiments, my conclusion is that the actual version (without my patch) seems to work well, with only one exception: the bottom-right notification that appears the first in a session shows misplaced (too down in the screen). However, subsequent notifications appears correctly.
Therefore, it seems that the problem is not in the width or height calculation, but in the Y position the first time the library needs to show a notification.
The notifications that appears in the top of the screen (update-notifier or rhythmbox) don't seem to have this problem.
I attach screenshots to illustrate the problem.