Finally I found a fix for the problem on emacswiki
(setq x-select-enable-primary t)
(setq select-enable-primary t)
(setq mouse-drag-copy-region t)
Quick tip: if you’re here looking to fix the fact that in Emacs shift-insert no longer pastes that text you highlighted with the mouse in your browser, the 2014 answer is to set x-select-enable-primary to true, and set mouse-drag-copy-region to true to go the other way - I can’t imagine why this excellent default was changed but it’s very hard to find the answer in the verbiage below.
But this works only for emacs installed from sources github/emacs-mirror, not 25.1
I also found that it depends on terminal. xterm fails, while vt100 works good