@@ -6490,12 +6490,22 @@ bool CMUSHView::Mouse_Move_MiniWindow (CMUSHclientDoc* pDoc, CPoint point)
6490
6490
string sHotspotId ;
6491
6491
string sMiniWindowId ;
6492
6492
6493
+ // find which miniwindow we are over, if any (and hotspot, if any)
6493
6494
mw = Mouse_Over_Miniwindow (pDoc, point, sHotspotId , pHotspot, sMiniWindowId );
6494
6495
6496
+ // the original hotspot that we moused over, in this window (if any)
6497
+ string sOldMouseOverHotspotInThisWindow ;
6498
+
6495
6499
if (mw)
6496
6500
{
6501
+ // remember mouse position in *this* window
6497
6502
mw->m_last_mouseposition = CPoint (point.x - mw->m_rect .left , point.y - mw->m_rect .top );
6498
6503
mw->m_last_mouse_update ++;
6504
+
6505
+ // remember original hotspot ID
6506
+ sOldMouseOverHotspotInThisWindow = mw->m_sMouseOverHotspot ;
6507
+ // change to new one for the benefit of WindowInfo (19)
6508
+ mw->m_sMouseOverHotspot = sHotspotId ;
6499
6509
}
6500
6510
6501
6511
@@ -6558,7 +6568,8 @@ bool CMUSHView::Mouse_Move_MiniWindow (CMUSHclientDoc* pDoc, CPoint point)
6558
6568
// end drag-and-drop
6559
6569
6560
6570
6561
- // next see if they have moved away from our previous miniwindow, if any
6571
+ // Next see if they have moved away from our previous miniwindow, if any
6572
+ // Note: This code is for when we change miniwindows
6562
6573
if (sMiniWindowId != m_sPreviousMiniWindow && !m_sPreviousMiniWindow.empty ())
6563
6574
{
6564
6575
@@ -6578,6 +6589,9 @@ bool CMUSHView::Mouse_Move_MiniWindow (CMUSHclientDoc* pDoc, CPoint point)
6578
6589
// lookup that HotspotId
6579
6590
HotspotMapIterator it = old_mw->m_Hotspots .find (old_mw->m_sMouseOverHotspot );
6580
6591
6592
+ string sOldMouseOverHotspot = old_mw->m_sMouseOverHotspot ;
6593
+ old_mw->m_sMouseOverHotspot .erase (); // no mouse-over right now (changed windows)
6594
+
6581
6595
// call CancelMouseOver for that hotspot, if it exists
6582
6596
if (it != old_mw->m_Hotspots .end ())
6583
6597
{
@@ -6586,10 +6600,9 @@ bool CMUSHView::Mouse_Move_MiniWindow (CMUSHclientDoc* pDoc, CPoint point)
6586
6600
Send_Mouse_Event_To_Plugin (it->second ->m_dispid_CancelMouseOver ,
6587
6601
old_mw->m_sCallbackPlugin ,
6588
6602
it->second ->m_sCancelMouseOver ,
6589
- old_mw-> m_sMouseOverHotspot );
6603
+ sOldMouseOverHotspot );
6590
6604
old_mw->m_bExecutingScript = false ;
6591
6605
}
6592
- old_mw->m_sMouseOverHotspot .erase (); // no mouse-over right now
6593
6606
m_sPreviousMiniWindow.erase (); // no longer have a previous mouse-over
6594
6607
} // we had previous hotspot
6595
6608
@@ -6599,17 +6612,21 @@ bool CMUSHView::Mouse_Move_MiniWindow (CMUSHclientDoc* pDoc, CPoint point)
6599
6612
} // moved to different window
6600
6613
6601
6614
6602
- // here if currently over a miniwindow
6615
+ // here if currently over a miniwindow and mouse is not captured (down)
6603
6616
if (mw && GetCapture () != this )
6604
6617
{
6605
6618
6606
6619
6607
- // cancel previous move-over hotspot (in this miniwindow)
6608
- if ((pHotspot == NULL || // not on any hotspot
6609
- mw->m_sMouseOverHotspot != sHotspotId ) // or on different hotspot
6610
- && !mw->m_sMouseOverHotspot .empty ()) // and we previously were over one in this miniwindow
6620
+ // Cancel previous move-over hotspot (in this miniwindow)
6621
+ // if either there is no hotspot at all, or there was a previous, different, one.
6622
+ // Note: Won't apply to changing miniwindows - we handled that above
6623
+
6624
+ if ((pHotspot == NULL || // not on any hotspot
6625
+ sOldMouseOverHotspotInThisWindow != sHotspotId )// or on different hotspot
6626
+ && !sOldMouseOverHotspotInThisWindow .empty () // and we previously were over one in this miniwindow
6627
+ && sMiniWindowId == m_sPreviousMiniWindow) // and it is the same miniwindow
6611
6628
{
6612
- HotspotMapIterator it = mw->m_Hotspots .find (mw-> m_sMouseOverHotspot );
6629
+ HotspotMapIterator it = mw->m_Hotspots .find (sOldMouseOverHotspotInThisWindow );
6613
6630
6614
6631
if (it != mw->m_Hotspots .end ())
6615
6632
{
@@ -6618,11 +6635,10 @@ bool CMUSHView::Mouse_Move_MiniWindow (CMUSHclientDoc* pDoc, CPoint point)
6618
6635
Send_Mouse_Event_To_Plugin (it->second ->m_dispid_CancelMouseOver ,
6619
6636
mw->m_sCallbackPlugin ,
6620
6637
it->second ->m_sCancelMouseOver ,
6621
- mw-> m_sMouseOverHotspot );
6638
+ sOldMouseOverHotspotInThisWindow );
6622
6639
mw->m_bExecutingScript = false ;
6623
6640
}
6624
6641
6625
- mw->m_sMouseOverHotspot .erase (); // no mouse-over right now
6626
6642
} // previous one which isn't this one, or we are no longer on one
6627
6643
6628
6644
// now, are we now over a hotspot?
@@ -6636,10 +6652,9 @@ bool CMUSHView::Mouse_Move_MiniWindow (CMUSHclientDoc* pDoc, CPoint point)
6636
6652
m_sPreviousMiniWindow = sMiniWindowId ; // remember in case they move outside window
6637
6653
6638
6654
// if different hotspot from before
6639
- if (sHotspotId != mw-> m_sMouseOverHotspot )
6655
+ if (sHotspotId != sOldMouseOverHotspotInThisWindow )
6640
6656
{
6641
6657
// this is our new one
6642
- mw->m_sMouseOverHotspot = sHotspotId ;
6643
6658
mw->m_bExecutingScript = true ;
6644
6659
Send_Mouse_Event_To_Plugin (pHotspot->m_dispid_MouseOver ,
6645
6660
mw->m_sCallbackPlugin ,
@@ -6706,6 +6721,21 @@ bool CMUSHView::Mouse_Down_MiniWindow (CMUSHclientDoc* pDoc, CPoint point, long
6706
6721
6707
6722
mw = Mouse_Over_Miniwindow (pDoc, point, sHotspotId , pHotspot, sMiniWindowId );
6708
6723
6724
+ // the original hotspot that we moused over, in this window (if any)
6725
+ string sOldMouseOverHotspotInThisWindow ;
6726
+
6727
+ if (mw)
6728
+ {
6729
+ // remember mouse position in *this* window
6730
+ mw->m_last_mouseposition = CPoint (point.x - mw->m_rect .left , point.y - mw->m_rect .top );
6731
+ mw->m_last_mouse_update ++;
6732
+
6733
+ // remember original hotspot ID
6734
+ sOldMouseOverHotspotInThisWindow = mw->m_sMouseOverHotspot ;
6735
+ // change to new one for the benefit of WindowInfo (19/20)
6736
+ mw->m_sMouseDownHotspot = sHotspotId ;
6737
+ }
6738
+
6709
6739
// ANY mouse-down cancels a previous mouse-over
6710
6740
if (!m_sPreviousMiniWindow.empty ())
6711
6741
{
@@ -6723,17 +6753,19 @@ bool CMUSHView::Mouse_Down_MiniWindow (CMUSHclientDoc* pDoc, CPoint point, long
6723
6753
// lookup that HotspotId
6724
6754
HotspotMapIterator it = old_mw->m_Hotspots .find (old_mw->m_sMouseOverHotspot );
6725
6755
6756
+ string sOldMouseOverHotspot = old_mw->m_sMouseOverHotspot ;
6757
+ old_mw->m_sMouseOverHotspot .erase (); // no mouse-over right now
6758
+
6726
6759
// call CancelMouseOver for that hotspot, if it exists
6727
6760
if (it != old_mw->m_Hotspots .end ())
6728
6761
{
6729
6762
old_mw->m_bExecutingScript = true ;
6730
6763
Send_Mouse_Event_To_Plugin (it->second ->m_dispid_CancelMouseOver ,
6731
6764
old_mw->m_sCallbackPlugin ,
6732
6765
it->second ->m_sCancelMouseOver ,
6733
- old_mw-> m_sMouseOverHotspot );
6766
+ sOldMouseOverHotspot );
6734
6767
old_mw->m_bExecutingScript = false ;
6735
6768
}
6736
- old_mw->m_sMouseOverHotspot .erase (); // no mouse-over right now
6737
6769
m_sPreviousMiniWindow.erase (); // no longer have a previous mouse-over
6738
6770
} // we had previous hotspot
6739
6771
@@ -6744,14 +6776,11 @@ bool CMUSHView::Mouse_Down_MiniWindow (CMUSHclientDoc* pDoc, CPoint point, long
6744
6776
// here if currently over a miniwindow
6745
6777
if (mw)
6746
6778
{
6747
-
6748
- mw->m_last_mouseposition = CPoint (point.x - mw->m_rect .left , point.y - mw->m_rect .top );
6749
- mw->m_last_mouse_update ++;
6779
+ mw->m_sMouseOverHotspot .erase ();
6750
6780
6751
6781
// now, are we now over a hotspot?
6752
6782
if (pHotspot)
6753
6783
{
6754
- mw->m_sMouseDownHotspot = sHotspotId ; // remember this is mousedown hotspot
6755
6784
mw->m_FlagsOnMouseDown = flags & 0x70 ; // remember mouse flags
6756
6785
mw->m_bExecutingScript = true ;
6757
6786
Send_Mouse_Event_To_Plugin (pHotspot->m_dispid_MouseDown ,
@@ -6782,6 +6811,38 @@ bool CMUSHView::Mouse_Up_MiniWindow (CMUSHclientDoc* pDoc, CPoint point, long fl
6782
6811
string sMiniWindowId ;
6783
6812
bool bPreviouslyInMiniwindow = false ;
6784
6813
6814
+ mw = Mouse_Over_Miniwindow (pDoc, point, sHotspotId , pHotspot, sMiniWindowId );
6815
+
6816
+ // the original hotspot that we moused over, in this window (if any)
6817
+ string sOldMouseDownHotspotInThisWindow ;
6818
+ string sOldMouseDownHotspot ;
6819
+
6820
+
6821
+ if (mw)
6822
+ {
6823
+ // remember mouse position in *this* window
6824
+ mw->m_last_mouseposition = CPoint (point.x - mw->m_rect .left , point.y - mw->m_rect .top );
6825
+ mw->m_last_mouse_update ++;
6826
+
6827
+ // remember original hotspot ID
6828
+ sOldMouseDownHotspotInThisWindow = mw->m_sMouseDownHotspot ;
6829
+ // change to new one for the benefit of WindowInfo (19/20)
6830
+ mw->m_sMouseOverHotspot = sHotspotId ;
6831
+ }
6832
+
6833
+ // find mouse-down hotspot in previous window, if any
6834
+ if (!m_sPreviousMiniWindow.empty ())
6835
+ {
6836
+ MiniWindowMapIterator it = pDoc->m_MiniWindows .find (m_sPreviousMiniWindow);
6837
+ if (it != pDoc->m_MiniWindows .end ())
6838
+ {
6839
+ sOldMouseDownHotspot = it->second ->m_sMouseDownHotspot ;
6840
+ it->second ->m_sMouseDownHotspot .empty ();
6841
+ }
6842
+ }
6843
+
6844
+ if (mw)
6845
+ mw->m_sMouseDownHotspot .erase ();
6785
6846
6786
6847
// drag-and-drop stuff
6787
6848
@@ -6805,16 +6866,17 @@ bool CMUSHView::Mouse_Up_MiniWindow (CMUSHclientDoc* pDoc, CPoint point, long fl
6805
6866
if (!prev_mw->m_sMouseDownHotspot .empty ()) // mouse was clicked
6806
6867
{
6807
6868
// lookup that HotspotId
6808
- HotspotMapIterator it = prev_mw->m_Hotspots .find (prev_mw-> m_sMouseDownHotspot );
6869
+ HotspotMapIterator it = prev_mw->m_Hotspots .find (sOldMouseDownHotspot );
6809
6870
6810
6871
// call ReleaseCallback for that hotspot, if it exists
6811
6872
if (it != prev_mw->m_Hotspots .end ())
6812
6873
{
6874
+
6813
6875
prev_mw->m_bExecutingScript = true ;
6814
6876
Send_Mouse_Event_To_Plugin (it->second ->m_dispid_ReleaseCallback ,
6815
6877
prev_mw->m_sCallbackPlugin ,
6816
6878
it->second ->m_sReleaseCallback ,
6817
- prev_mw-> m_sMouseDownHotspot ,
6879
+ sOldMouseDownHotspot ,
6818
6880
prev_mw->m_FlagsOnMouseDown );
6819
6881
prev_mw->m_bExecutingScript = false ;
6820
6882
}
@@ -6831,9 +6893,6 @@ bool CMUSHView::Mouse_Up_MiniWindow (CMUSHclientDoc* pDoc, CPoint point, long fl
6831
6893
// end drag-and-drop
6832
6894
6833
6895
6834
-
6835
- mw = Mouse_Over_Miniwindow (pDoc, point, sHotspotId , pHotspot, sMiniWindowId );
6836
-
6837
6896
// A mouse-up not in this miniwindow cancels a previous mouse-down
6838
6897
if (sMiniWindowId != m_sPreviousMiniWindow && !m_sPreviousMiniWindow.empty ())
6839
6898
{
@@ -6851,10 +6910,10 @@ bool CMUSHView::Mouse_Up_MiniWindow (CMUSHclientDoc* pDoc, CPoint point, long fl
6851
6910
old_mw->m_last_mouse_update ++;
6852
6911
6853
6912
// cancel previous move-down hotspot
6854
- if (!old_mw-> m_sMouseDownHotspot .empty ()) // HotspotId was used
6913
+ if (!sOldMouseDownHotspot .empty ()) // HotspotId was used
6855
6914
{
6856
6915
// lookup that HotspotId
6857
- HotspotMapIterator it = old_mw->m_Hotspots .find (old_mw-> m_sMouseDownHotspot );
6916
+ HotspotMapIterator it = old_mw->m_Hotspots .find (sOldMouseDownHotspot );
6858
6917
6859
6918
// call CancelMouseDown for that hotspot, if it exists
6860
6919
if (it != old_mw->m_Hotspots .end ())
@@ -6863,11 +6922,10 @@ bool CMUSHView::Mouse_Up_MiniWindow (CMUSHclientDoc* pDoc, CPoint point, long fl
6863
6922
Send_Mouse_Event_To_Plugin (it->second ->m_dispid_CancelMouseDown ,
6864
6923
old_mw->m_sCallbackPlugin ,
6865
6924
it->second ->m_sCancelMouseDown ,
6866
- old_mw-> m_sMouseDownHotspot ,
6925
+ sOldMouseDownHotspot ,
6867
6926
old_mw->m_FlagsOnMouseDown );
6868
6927
old_mw->m_bExecutingScript = false ;
6869
6928
}
6870
- old_mw->m_sMouseDownHotspot .erase (); // no mouse-down right now
6871
6929
} // we had previous hotspot
6872
6930
6873
6931
} // previous window still exists
@@ -6881,36 +6939,34 @@ bool CMUSHView::Mouse_Up_MiniWindow (CMUSHclientDoc* pDoc, CPoint point, long fl
6881
6939
// here if currently over a miniwindow
6882
6940
if (mw)
6883
6941
{
6942
+ mw->m_sMouseDownHotspot .erase ();
6884
6943
6885
- mw->m_last_mouseposition = CPoint (point.x - mw->m_rect .left , point.y - mw->m_rect .top );
6886
- mw->m_last_mouse_update ++;
6887
6944
ReleaseCapture (); // Release the mouse capture established at
6888
6945
// the beginning of the mouse click.
6889
6946
6890
6947
// if mouse-up outside the current hotspot just cancel previous one
6891
6948
// cancel previous mouse-down hotspot (in this miniwindow)
6892
6949
if ((pHotspot == NULL || // not on any hotspot
6893
- mw-> m_sMouseDownHotspot != sHotspotId ) // or on different hotspot
6894
- && !mw-> m_sMouseDownHotspot .empty ()) // and we previously were down in this miniwindow
6950
+ sOldMouseDownHotspotInThisWindow != sHotspotId ) // or on different hotspot
6951
+ && !sOldMouseDownHotspotInThisWindow .empty ()) // and we previously were down in this miniwindow
6895
6952
{
6896
- HotspotMapIterator it = mw->m_Hotspots .find (mw-> m_sMouseDownHotspot );
6953
+ HotspotMapIterator it = mw->m_Hotspots .find (sOldMouseDownHotspotInThisWindow );
6897
6954
6898
6955
if (it != mw->m_Hotspots .end ())
6899
6956
{
6900
6957
mw->m_bExecutingScript = true ;
6901
6958
Send_Mouse_Event_To_Plugin (it->second ->m_dispid_CancelMouseDown ,
6902
6959
mw->m_sCallbackPlugin ,
6903
6960
it->second ->m_sCancelMouseDown ,
6904
- mw-> m_sMouseDownHotspot ,
6961
+ sOldMouseDownHotspotInThisWindow ,
6905
6962
mw->m_FlagsOnMouseDown );
6906
6963
mw->m_bExecutingScript = false ;
6907
6964
}
6908
6965
6909
- mw->m_sMouseDownHotspot .erase (); // no mouse-down right now
6910
6966
} // previous one which isn't this one, or we are no longer on one
6911
6967
6912
6968
// now, did we release mouse over the hotspot it went down in?
6913
- if (pHotspot && mw-> m_sMouseDownHotspot == sHotspotId )
6969
+ if (pHotspot && sOldMouseDownHotspotInThisWindow == sHotspotId )
6914
6970
{
6915
6971
mw->m_bExecutingScript = true ;
6916
6972
Send_Mouse_Event_To_Plugin (pHotspot->m_dispid_MouseUp ,
@@ -6919,11 +6975,12 @@ bool CMUSHView::Mouse_Up_MiniWindow (CMUSHclientDoc* pDoc, CPoint point, long fl
6919
6975
sHotspotId ,
6920
6976
mw->m_FlagsOnMouseDown ); // LH / RH mouse?
6921
6977
mw->m_bExecutingScript = false ;
6922
- mw->m_sMouseDownHotspot .erase (); // no mouse-down right now
6923
6978
}
6924
6979
6925
6980
m_sPreviousMiniWindow.erase (); // no longer have a previous mouse-over
6926
6981
6982
+ mw->m_sMouseOverHotspot .erase (); // erase it so Mouse_Move_MiniWindow will work
6983
+ Mouse_Move_MiniWindow (pDoc, point); // we are no longer down so maybe we are over again
6927
6984
return true ; // we are over mini-window - don't check for underlying text
6928
6985
}
6929
6986
0 commit comments