xwinclip re selection polling

Harold L Hunt huntharo@msu.edu
Thu Aug 29 11:00:00 GMT 2002


Chris,

Well, I am glad that someone is working on xwinclip other than me.  However, I
did not respond to the proposed solution because I was not entirely convinced
that it was the best approach to take or even that a problem existed that
needed to be solved.

Of course, the best way to deal with me is to just program me into submission,
which you are currently on your way to doing.  If I have a patch sent in that
is cleanly formatted and adds functionality without breaking any existing
functionality nor does it add any significant new bugs, then I can do little
else than accept and apply the patch.

Do note that a patch that does not follow the naming conventions (e.g., g_foo
for globals, pszString for char *'s, etc.) and formatting conventions (just
look at a function definition and use emacs' indent option) will essentially
get ignored.  Or rather, I'll look at it, I'll start cleaning it up, I'll get
pissed off that I am wasting my time doing something that could have been done
right in the first place by someone else, and I'll throw the patch out and put
less weight on the future contributions of such developers.  So, please format
your patch correctly :)

In conclusion, I am just waiting for a patch that you want me to review. 
Don't rush, do it right, let me (the mailing list) know when you want a
review.  Of course, it does not hurt to keep us posted as to what you are
doing and questions are fine as well.

Harold

Chris Twiner <c_twiner@hotmail.com> said:

> Hi All,
> 
> I posted last week that I had a possible solution to the xwinclip selection 
> behaviour.  I didn't get any feedback so I endeavoured to do it anyway.  So 
> this ones a bit long but it's an explanation of how I've got it working ..
> 
> Basic premise :
> 
> Use a seperate dll that runs a system wide Windoze hook to catch all 
> activate messages.  2 events are of interest in the hook, when 
> Cygwin/XFree86 is activated and when it is deactivated.  When an event is 
> detected the hook then sends a broadcast registered message to all top level 
> windows.
> 
> The top level Windoze window for xwinclip is run in a seperate thread and as 
> such always receives the messages.  Upon receipt of the activation messages 
> flags are set up that indicate that either xtowindows be called or 
> windowstox.  These functions copy the data in the respective directions.
> 
> The flags have to be used so the main thread (the owner of pDisplay) is the 
> one that calls the functions.  They in turn either XSetSelectionOwner 
> (windowstox) or they XConvertSelection (xtowindows) to set the messages 
> running.
> 
> Major changes are that the select in xwinclip.c has a time limit applied and 
> that the XSetSelectionOwner in xevents.c and XSetSelectionOwner in 
> xwinclip.c are removed.
> 
> This means that all selection operations behave as expected in XWin with 
> xwinclip running.
> 
> However I have some limitations:
> 
> closing xwinclip:
>    closing XWin closes xwinclip but doesn't go through WM_DESTROY on the x 
> window, just
> XIO:  fatal IO error 113 (Connection aborted) on X server "127.0.0.1:0.0"
>       after 48 requests (47 known processed) with 0 events remaining.
>    I made a script to close xwinclip via sending an X message but it results 
> in crashing XWin as well.
> 
> the select statement timeout:
>    In order to get the polling on the notification flags (from the windows 
> thread) the timer is set to 1 sec (or some other time).  Is there a way to 
> make the flags act as file descriptors for the select statement?
> 
> Any help on the problems would be appreciated.
> 
> The code is still (cough cough) a little rough n ready so I will release it 
> when appropriate.  Is putting a zip attachment on this mailing list 
> appropriate?
> 
> I have only been working on this for 3 days and it's my first attempt at X 
> antics so if these are FAQ style items I appologise (I've looked just can't 
> find them).
> 
> Regards,
> 
> Chris Twiner
> 
> _________________________________________________________________
> Send and receive Hotmail on your mobile device: http://mobile.msn.com
> 
> 





More information about the Cygwin-xfree mailing list