Esme Povirk (@madewokherd) commented about dlls/winex11.drv/clipboard.c:
- XSelectInput( display, win, attrs.your_event_mask | PropertyChangeMask );
- /* Generate a PropertyNotify event to get server time */
- XChangeProperty( display, win, x11drv_atom(__wine_timestamp_prop), XA_INTEGER, 8, PropModeReplace, NULL, 0 );
- XSync( display, False );
- /* Wait for the PropertyNotify event */
- for (i = 0; i < SELECTION_RETRIES; i++)
- {
if(XCheckIfEvent( display, &event, timestamp_predicate, (XPointer)win )){timestamp = event.xproperty.time;break;}selection_sleep();- }
I'm not sure how we should handle the case where we don't see the event we're expecting. It's unclear to me from the documentation whether `XSync` should guarantee that we see the event (no other client is involved so.. maybe?). And I don't know whether we need a timeout or not, since we should get the event as long as the server is functioning properly and no one destroys the selection window in the small amount of time between creating it and calling this.
It's also unclear to me whether we need to temporarily change our event selection, or whether we could just do it at window creation time.
Since I'm not actually the maintainer in this area and am only reviewing out of interest anyway, I think it's best for me to just bring these up as a unresolved questions.