[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Texmacs-dev] Copy and paste
From: |
Norbert Nemec |
Subject: |
Re: [Texmacs-dev] Copy and paste |
Date: |
Wed, 07 Oct 2009 18:39:06 +0100 |
User-agent: |
Thunderbird 2.0.0.23 (X11/20090817) |
Hi Joris,
I just checked the patches. I believe I understand the problem.
SetSelectionOwner issues a SelectionClearEvent, but this is then of
course queued and handled later on. If the same instance of TeXmacs
already was the owner, the selection is then first replaced and cleared
afterwards. I wonder why I did not notice this in testing. I have not
used the X11 interface in some time.
In any case, I don't see any cleaner solution than the one that you
implemented.
However, there is another detail in your patch that seems unrelated and
incorrect to me:
-----------
+++ b/src/src/Plugins/X11/x_gui.cpp
@@ -217,7 +217,7 @@ x_gui_rep::get_selection (string key, tree& t,
string& s) {
if (selection_t->contains (key)) {
t= copy (selection_t [key]);
s= copy (selection_s [key]);
- res=true;
+ return true;
}
-----------
In fact, this line *should* read "res=true". The point is that the fact
that TeXmacs has *a* selection does not mean that it actually owns *the*
selection. Only a check of GetSelectionOwner can tell this. I am not
sure whether this would ever make problems in practice. I am not sure
whether the ClearSelection mechanism can be trusted in every case.
Greetings,
Norbert
Joris van der Hoeven wrote:
Hi,
I discovered several bugs with the new copy and paste system.
One problem concerns the fact that SelectionClear events are
issued even if we were already the owner of the previous selection.
As a consequence, we lost the original TeXmacs tree and mode information.
I implement a dirty fix, but the fix might introduce other problems;
any better solution would be welcome.
As to the Qt port, one has to make sure that copy-and-paste from
within TeXmacs really uses the tree information and is not merely textual
(i.e. uses t instead of s in selection_paste). Please check.
Best wishes, --Joris
_______________________________________________
Texmacs-dev mailing list
address@hidden
http://lists.gnu.org/mailman/listinfo/texmacs-dev