TrayIcon.GetPosition in Windows is wrong when task bar is not at the bottom (patch included)
Original Reporter info from Mantis: ZLedas @zledas
-
Reporter name: Žilvinas Ledas
Original Reporter info from Mantis: ZLedas @zledas
- Reporter name: Žilvinas Ledas
Description:
TrayIcon.GetPosition in Windows is wrong when task bar is not at the bottom, as the current code always returns:
Result.X := TaskbarRect.Right;
Result.Y := TaskbarRect.Top;
Attached patch fixes this problem and is multi-monitor aware.
Additional information:
First IF branch can be extended to:
---
if (TaskbarRect.Top - TaskbarMonitor.Top = 0) and (TaskbarRect.Left - TaskbarMonitor.Left = 0) and (TaskbarRect.Right > TaskbarRect.Bottom) then
begin
{ Taskbar is at the top of the monitor area }
Result.X := TaskbarRect.Right;
Result.Y := TaskbarRect.Bottom;
end
else if (TaskbarRect.Top - TaskbarMonitor.Top = 0) and (TaskbarRect.Left - TaskbarMonitor.Left = 0) and (TaskbarRect.Right <= TaskbarRect.Bottom) then
begin
{ Taskbar is on the left side of the monitor area }
Result.X := TaskbarRect.Right;
Result.Y := TaskbarRect.Bottom;
end
else if (TaskbarRect.Left - TaskbarMonitor.Left = 0) then
< ... >
---
but provided code in the patch is shortened.
Mantis conversion info:
- Mantis ID: 17549
- Version: 0.9.29 (SVN)
- Fixed in version: 0.9.29 (SVN)
- Fixed in revision: 27584 (#7b871390)
- Target version: 0.9.30