| | 111 | |
|---|
| | 112 | // If this view was moved to a new window, determine if the mouse is |
|---|
| | 113 | // currently within the bounds of this view. If it is, then we post a |
|---|
| | 114 | // fake mouseEntered event to inform this view that the mouse is within |
|---|
| | 115 | // it. Without this, the user would have to move the mouse out of the |
|---|
| | 116 | // window and back in to get the mouseEntered event to be posted. |
|---|
| | 117 | if ( [self window] ) |
|---|
| | 118 | { |
|---|
| | 119 | const NSPoint mouse_loc = |
|---|
| | 120 | [[self window] mouseLocationOutsideOfEventStream]; |
|---|
| | 121 | const NSRect bounds = [self bounds]; |
|---|
| | 122 | |
|---|
| | 123 | if ( [self mouse:mouse_loc inRect:bounds] ) |
|---|
| | 124 | { |
|---|
| | 125 | // XXX: Would it work better to use CGPostMouseEvent() here? |
|---|
| | 126 | [self mouseEntered:nil]; |
|---|
| | 127 | } |
|---|
| | 128 | } |
|---|