Selection bug/feature

I've been doing a little work on Anjuta, a gtk-based IDE, and have 
tracked down a problem that's causing copy/paste to break.  It turns out 
that the gtk/gdk selection handling code tracks a widget via its gdk 
parent window, and Anjuta sometimes reparents its Scintilla editing 
widget (sticks it an an hpane or a vpane).  This breaks things since any 
attempt to retrieve the selection fails (gtk/gdk can't find the editing 
widget properly after it's been reparented).

The simplest way to get around this in Anjuta seems to be to relinquish 
ownership of the "CLIPBOARD" selection when the editing widget is 
unrealized/unmapped, and then to reclaim it when the widget is 
realized/mapped after being reparented.  This seems to work nicely.

Questions though:

1) Anyone see any problems doing it this way?

2) Is it worth trying to keep the Scintilla widget in an intermediate 
container, and reparent that container, rather than directly reparenting 
the Scintilla?

3) Is it better to reclaim the "CLIPBOARD" selection when mapped or 

4) Is it better to tweak the gtk/gdk selection code to deal with this 
reparenting directly?

Any thoughts, folks?


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]