https://bugs.winehq.org/show_bug.cgi?id=50598
--- Comment #3 from Pau Coma Ramirez paucoma@gmail.com --- So Investigating the source code
https://source.winehq.org/git/wine.git/blob/HEAD:/dlls/winex11.drv/clipboard...
2111 if ((event->selection != x11drv_atom(CLIPBOARD)) && 2112 (!use_primary_selection || event->selection != XA_PRIMARY)) goto done;
Searching for who was seeting the variable <use_primary_selection>
dlls/winex11.drv/x11drv_main.c 74 BOOL use_primary_selection = FALSE;
397 if (!get_config_key( hkey, appkey, "UsePrimarySelection", buffer, sizeof(buffer) )) 398 use_primary_selection = IS_OPTION_TRUE( buffer[0] );
Specifically within the function [static void setup_options(void)](https://source.winehq.org/git/wine.git/blob/HEAD:/dlls/winex11.drv/x11drv_ma...)
First it checks if the /* @@ Wine registry key: HKCU\Software\Wine\X11 Driver */ exists and assigns handle to hkey Second it checks if the /* @@ Wine registry key: HKCU\Software\Wine\AppDefaults */ exits Then checks if the /* @@ Wine registry key: HKCU\Software\Wine\AppDefaults\app.exe\X11 Driver */ exists and assigns handle to appkey
the function `get_config_key(...)` First checks the application specific value `HKCU\Software\Wine\AppDefaults\app.exe\X11 Driver\UsePrimarySelection" and returns its assigned value if it exists if it did not find an application specific value it checks the current user "general" value HKCU\Software\Wine\X11 Driver\UsePrimarySelection" and returns its assigned value if it exists
"True" has the following equivalencies. 121 #define IS_OPTION_TRUE(ch) \ 122 ((ch) == 'y' || (ch) == 'Y' || (ch) == 't' || (ch) == 'T' || (ch) == '1')
I have added a specific registry for the app, and it has no influence on the app when started through the ubuntu launcher. When started from a terminal, currently it works. when earlier it didn't without the registry key. Yet previously it had worked without the registry key so I am not convinced that this is this... appears kinda randomly.... well requires more testing.. I will continue testing with the app specific registry key in place and see how it behaves.