Test setup:

  1. Load this page in a webengine based browser
  2. Make sure QWebEngineSettings.WebAttribute.JavascriptCanAccessClipboard is set to true
  3. Have the ability to inspect your X11 clipboards like this shell function
    
        printf "primary  : %s\nclipboard: %s\n" "$(xclip -o)" "$(xclip -o -selection clipboard)"
        
  4. Now go through the below steps and inspect the clipboard after each one:
    1. First set both clipboards to the same known value: highlight line one and copy with ctrl+c. Your clipboards should now display:
      
            primary  : Line one: highlight and copy me
            clipboard: Line one: highlight and copy me
            
    2. Now highlight line two to change the primary selection to be different from the clipboard. Your clipboards should now display:
      
            primary  : Line two: only highlight me
            clipboard: Line one: highlight and copy me
            
    3. Now press the button the will copy to the clipboard. On QtWebEngine 6.6.1 (and all previous versions as far as i can remember) your clipboards should display the following:
      
            primary  : clipboard text
            clipboard: clipboard text
            
  5. The problem is that on the 6.7 branch only the clipboard will get updated, the primary selection will stay as "Line two":
    
        primary  : Line two: only highlight me  <== this is a change in behaviour
        clipboard: clipboard text
        

Line one: highlight and copy me

Line two: only highlight me