xwinclip re selection polling

Harold L Hunt II huntharo@msu.edu
Thu Aug 29 13:51:00 GMT 2002


Jehan,

As far as integrating xwinclip into XWin.exe - Chris would be stuck by 
the same problem that I am: that the process hosting the xwinclip X 
client connection gets killed when X shuts down or resets and the client 
connection is still open.

I have searched for months and months for a way to receive a definite 
signal that the X server is about to shutdown.  There is a hook provided 
by most window managers to indicate that the display is closeing, but it 
has so far given mixed results.  The last idea I saw was in the x2x (I 
think) source code, which interfaces with the raw Xlib, just like 
xwinclip.  It looked like x2x was watching for a move message for the 
mouse to (0, 0) (or some other special point) and it took this as a 
signal to close the X client connection.

I have yet to investigate whether watching for this certain mouse 
message provides the functionality that we need.

Harold

Jehan wrote:
> Chris Twiner wrote:
> 
>> I have attached a zip with the complete files in there, not just diffs 
>> etc in case the base version is different now.  They xwinclip normal 
>> files and the xwinclip_hook file additions have been changed to agree 
>> with the sytle guidelines Harold pointed out.
>>
>> kill_xwinclip.c and kill_xwclip_hook.c haven't but there isn't much to 
>> them anyway, and I'd like to figure out a way to remove them anyway.
> 
> [...]
> 
>> Hope the format is ok. If not tell me and I'll send them back with 
>> whatever changes are necessary. Cygwin is a great tool, I want to 
>> contribute.
> 
> 
> There is some obvious cleaning to do here. First, is to use only tabs or 
> only spaces (don't remember which one Harold uses). Having a mix of 
> space and tabs is a big mess for people who don't use the same tab size 
> (8 vs 4 vs 3 vs 2).
> 
> Some files (windproc.c at least) has a huge number of spaces/tabs at 
> then end of line (see KillXWinclip function ).
> 
> Some files don't have indentation at all (kill_xwinclip.c) or barely 
> (kill_xclip_hook.c). As you said, there isn't much to them anyway so 
> it's not a huge task to clean them but that will still help others who 
> would want to look at the code. Also, even if you want to get rid of 
> them, you don't know how long they will stay. There was once a guy who 
> said that storing the date with only 2 digits was be good enough, that 
> by the time we would get to 2000, the software would have been replaced 
> and corrected... you know the end of the story ;)
> 
> I don't know how much of the problems are yours or from the original 
> code (never looked at it) but it would be a good thing to have that 
> cleaned in any case.
> 
> 
>> Untested and definitely won't work is running more than one screen. 
>> The hook relies on the Cygwin/XFree86 window title, it will therefor 
>> not work with more than one screen.
> 
> 
> What about trying to integrate xwinclip inside XWin? It would fix this 
> problem since you don't have to create the Hook. You just have to add a 
> call to the owner thingie in xwinwndproc.c file. It would also allow to 
> get rid of the two files you want to remove ;). Last, it would reduce 
> the size of the Cygwin/XFree to-do list (a killer feature for Harold ;)).
> 
>     Jehan
> 
> 
> 



More information about the Cygwin-xfree mailing list