I've set this in emacs:
(setq x-select-enable-clipboard t)
And it works just fine.
That is, until I copy something from within emacs using cua-copy (bound to C-c). Then, whenever I try to copy something from other programs and paste it into emacs, it keeps pasting the same entry it last copied using cua-copy.
The clipboard itself still works - the same entry is pasted regularly in any other program.
So far I tried defining several things but to no avail:
(setq x-select-enable-primary nil)
(setq x-select-enable-clipboard t)
(setq select-active-regions t)
(global-set-key [mouse-2] 'mouse-yank-primary)
(setq yank-pop-change-selection t)
(setq interprogram-paste-function 'x-cut-buffer-or-selection-value)
Only when I forcefully paste from the clipboard using the command x-clipboard-yank does it resolve to its proper state, until I use cua-copy again.
Did anyone Ever encountered such a problem, or have any idea how to solve it?