You should be able to choose either real selection or the shadow selection as the "owner" though. There shouldn't be a need to put the real selection back into sync, except that the current selectRange goes about deriving the current selection from the window rather than the shadow cursor :-). The worst case scenario if you don't call this line is that you get the same behaviour as without a shadow cursor (i.e., the existing real-selection implementation).