@@ -546,6 +546,8 @@ long CMUSHclientDoc::WindowAddHotspot(LPCTSTR Name,
546
546
if (it == m_MiniWindows.end ())
547
547
return eNoSuchWindow;
548
548
549
+ CMiniWindow * mw = it->second ;
550
+
549
551
static bool bInWindowAddHotspot = false ;
550
552
551
553
// don't recurse into infinite loops
@@ -561,29 +563,39 @@ static bool bInWindowAddHotspot = false;
561
563
562
564
long status;
563
565
564
- status = it-> second -> AddHotspot (this ,
565
- HotspotId,
566
- sPluginID ,
567
- Left, Top, Right, Bottom,
568
- MouseOver,
569
- CancelMouseOver,
570
- MouseDown,
571
- CancelMouseDown,
572
- MouseUp,
573
- TooltipText,
574
- Cursor,
575
- Flags);
566
+ status = mw-> AddHotspot (this ,
567
+ HotspotId,
568
+ sPluginID ,
569
+ Left, Top, Right, Bottom,
570
+ MouseOver,
571
+ CancelMouseOver,
572
+ MouseDown,
573
+ CancelMouseDown,
574
+ MouseUp,
575
+ TooltipText,
576
+ Cursor,
577
+ Flags);
576
578
577
579
// in mouse was over hotspot when it was created, do a "mouse move" to detect this
578
580
if (status == eOK)
579
581
{
580
- for (POSITION pos=GetFirstViewPosition ();pos!=NULL ;)
581
- {
582
- CView* pView = GetNextView (pos);
583
-
584
- if (pView->IsKindOf (RUNTIME_CLASS (CMUSHView)))
585
- ((CMUSHView*)pView)->Mouse_Move_MiniWindow (this , m_lastMousePosition);
586
- } // end of looping through views
582
+
583
+ // only check the current hotspot, not all of them
584
+ HotspotMapIterator it = mw->m_Hotspots .find (HotspotId);
585
+ if (it != mw->m_Hotspots .end ())
586
+ {
587
+ CHotspot * pHotspot = it->second ;
588
+ if ( pHotspot->m_rect .PtInRect (mw->m_last_mouseposition ) )
589
+ {
590
+ for (POSITION pos=GetFirstViewPosition ();pos!=NULL ;)
591
+ {
592
+ CView* pView = GetNextView (pos);
593
+
594
+ if (pView->IsKindOf (RUNTIME_CLASS (CMUSHView)))
595
+ ((CMUSHView*)pView)->Mouse_Move_MiniWindow (this , m_lastMousePosition);
596
+ } // end of looping through views
597
+ }
598
+ } // end of hotspot found
587
599
} // end of added hotspot OK
588
600
589
601
0 commit comments