@@ -36,6 +36,8 @@ def __init__(self, parent, renderer):
36
36
self .drag_start_x = None
37
37
self .drag_start_y = None
38
38
self .drag_rect = None
39
+ #FAU 20250120: mouse_select_ongoing positionned to avoid the race with event of selection change in TextCtrl
40
+ self .mouse_select_ongoing = False
39
41
self .SetVirtualSize ((self .buffer_width , self .buffer_height ))
40
42
self .SetScrollbars (20 , 20 , 50 , 50 )
41
43
# 1.3.6.2 [JWdJ] 2015-02-14 hook events after initializing to prevent unnecessary redraws
@@ -92,6 +94,8 @@ def get_xy_of_mouse_event(self, event):
92
94
93
95
def OnLeftButtonDown (self , event ):
94
96
if event .LeftDown ():
97
+ #FAU 20250126: mouse_select_ongoing positionned to avoid the race with event of selection change in TextCtrl
98
+ self .mouse_select_ongoing = True
95
99
self .SetFocus ()
96
100
page = self .current_page
97
101
old_selection = page .selected_indices .copy ()
@@ -143,6 +147,8 @@ def OnLeftButtonUp(self, event):
143
147
self .drag_rect = None
144
148
self .OnMouseMotion (event )
145
149
self .redraw ()
150
+ #FAU 20250126: mouse_select_ongoing positionned to avoid the race with event of selection change in TextCtrl
151
+ self .mouse_select_ongoing = False
146
152
147
153
def OnMouseMotion (self , event ):
148
154
page = self .current_page
@@ -162,6 +168,8 @@ def OnMouseMotion(self, event):
162
168
self .SetCursor (self .pointer_cursor )
163
169
else :
164
170
self .SetCursor (self .cross_cursor )
171
+ #FAU 20250126: mouse_select_ongoing positionned to avoid the race with event of selection change in TextCtrl
172
+ self .mouse_select_ongoing = False
165
173
## if self.HasCapture():
166
174
## x, y = self.get_xy_of_mouse_event(event)
167
175
## self.drag_rect = (min(self.drag_start_x, x), min(self.drag_start_y, y), abs(self.drag_start_x-x), abs(self.drag_start_y-y))
@@ -277,7 +285,8 @@ def draw_notes_highlighted(self, note_indices):
277
285
self .Update ()
278
286
finally :
279
287
self .redrawing = False
280
- self .highlighted_notes = None
288
+ if not wx .Platform == "__WXMAC__" :
289
+ self .highlighted_notes = None
281
290
282
291
def Draw (self ):
283
292
dc = wx .BufferedDC (None , self .renderer .buffer )
0 commit comments