Opened 3 years ago
Last modified 5 days ago
#23002 new defect
[patch] Inconsistent notification position
| Reported by: | gaben | Owned by: | team |
|---|---|---|---|
| Priority: | normal | Milestone: | 26.09 |
| Component: | Core | Version: | |
| Keywords: | notification position | Cc: | GerdP |
Description (last modified by )
What steps will reproduce the problem?
- Do something which produces a notification (upload, tool error etc.)
- Pay attention of the notification position
- Repeat steps 1-2 with full screen mode
What is the expected result?
Notification position is consistent among viewing modes.
What happens instead?
Full screen messes up the notifications position and also in normal mode the position is a bit off.
Please provide any additional information below. Attach a screenshot if possible.
Revision:18750
Is-Local-Build:true
Build-Date:2023-06-11 16:13:37
Identification: JOSM/1.5 (18750 SVN en) Linux Ubuntu 20.04.6 LTS
Memory Usage: 236 MB / 2480 MB (75 MB allocated, but free)
Java version: 11.0.19+7-post-Ubuntu-0ubuntu120.04.1, Ubuntu, OpenJDK 64-Bit Server VM
Look and Feel: javax.swing.plaf.metal.MetalLookAndFeel
Screen: :0.0 1918×1020 (scaling 1.00×1.00)
Maximum Screen Size: 1918×1020
Best cursor sizes: 16×16→16×16, 32×32→32×32
Environment variable LANG: hu_HU.UTF-8
System property file.encoding: UTF-8
System property sun.jnu.encoding: UTF-8
Locale info: en_HU
Numbers with default locale: 1234567890 -> 1234567890
Desktop environment: ubuntu:GNOME
Java package: openjdk-11-jre:amd64-11.0.19+7~us1-0ubuntu1~20.04.1
Java ATK Wrapper package: libatk-wrapper-java:all-0.37.1-1
fonts-noto: fonts-noto:-
VM arguments: [-Dfile.encoding=UTF-8]
Program arguments: [--debug, ${HOME}/Letöltések/Teleki_cycle.osm.gz]
Dataset consistency test: No problems found
Plugins:
+ utilsplugin2 (36079)
Validator rules:
+ https://josm.openstreetmap.de/josmfile?page=Rules/Runways&zip=1
Attachments (5)
Change History (16)
by , 3 years ago
| Attachment: | josm_23002_notification.patch added |
|---|
by , 3 years ago
comment:1 by , 3 years ago
| Description: | modified (diff) |
|---|
comment:2 by , 3 years ago
| Keywords: | notification position added |
|---|
comment:3 by , 3 years ago
Just noticed #22751 which can mess up the positions (therefore this patch) a little bit.
comment:4 by , 3 years ago
I just merged #22751. Let me know if/when you've checked to make certain it hasn't borked your patch.
follow-up: 6 comment:5 by , 3 years ago
| Milestone: | 23.06 |
|---|---|
| Summary: | [patch] Inconsistent notification position → [WIP patch] Inconsistent notification position |
It did, completely.
Honestly, I've spent too much time on this and it's going nowhere.
Edit: It does affect Linux when the notification has more than one line (as on the animation).
comment:6 by , 3 years ago
Replying to gaben:
It did, completely.
Sorry about that.
Honestly, I've spent too much time on this and it's going nowhere.
The hard part will be figuring out how to test it so that we don't regress.
by , 3 years ago
| Attachment: | y_axis_zero.png added |
|---|
comment:7 by , 3 years ago
No probs, it happens.
So if you set notification's y-axis via y = mapViewPos.y here source:josm/trunk/src/org/openstreetmap/josm/gui/NotificationManager.java?rev=18763#L143, it should show up touching the map view's top.
Instead, this is what you get after applying #22751:
comment:8 by , 3 years ago
There is a visual debugger, that may help https://netbeans.apache.org/kb/docs/java/debug-visual.html
Unfortunately, I wasn't able to get JOSM run in Netbeans :(
comment:10 by , 5 days ago
The patch is bigger than expected, due to the findings along the way.
First of all, the notification position was computed in the main frame's coordinate system, while the panel goes into the frame's layered pane. The two differ by the window decoration insets, which are only there outside fullscreen mode, hence the different spot depending on whether the window is fullscreen. It is now computed against the container the panel is actually added to, and recomputed while the notification is up, so it also follows window resizes and layout changes.
Also fixed along the way:
- a deadlock, when a notification is shown from a worker thread
- an NPE in mouseEntered() after the panel was removed
- the hide timer restarted by the mouse exit event of that very panel
- duplicates queued again, unless they matched the last queued notification
- the same message dropped as a duplicate when triggered right after it disappeared
- replacing a notification hiding an unrelated one
- a notification left sitting over the status line, when a layer is opened while it is up
- an antialiasing hint leaking out of RoundedPanel
- the close button and the panel margin ignoring the interface scale, and
- long notifications starting above the top of the window.
NotificationManagerTest covers most of these.
by , 5 days ago
| Attachment: | 23002.patch added |
|---|
by , 5 days ago
| Attachment: | 23002.2.patch added |
|---|
comment:11 by , 5 days ago
| Cc: | added |
|---|---|
| Summary: | [WIP patch] Inconsistent notification position → [patch] Inconsistent notification position |
Oh I didn't know Trac can autoversion the uploads.
Anyway, testers needed! :)
In my own testing, it worked perfectly on both Windows and Linux.





fix gif position