diff options
author | nyamatongwe <unknown> | 2000-07-15 07:39:02 +0000 |
---|---|---|
committer | nyamatongwe <unknown> | 2000-07-15 07:39:02 +0000 |
commit | fbc8d3a114b6fdf12dfe6f56e3893f935dcb74c3 (patch) | |
tree | 82c3a4e690d961ad4fc9d74a8ca09dc44f925d4e | |
parent | 610b069a39986a922b2281bfb9c8a9d07561cafc (diff) | |
download | scintilla-mirror-fbc8d3a114b6fdf12dfe6f56e3893f935dcb74c3.tar.gz |
Fixed problem with CancelModes killing drag and drop by setting empty
selection.
On GTK+ double click GTK+ events are ignored as this led to prblems
in primary selection code.
-rw-r--r-- | gtk/ScintillaGTK.cxx | 7 | ||||
-rw-r--r-- | src/Editor.cxx | 3 | ||||
-rw-r--r-- | src/ScintillaBase.cxx | 4 | ||||
-rw-r--r-- | src/ScintillaBase.h | 2 |
4 files changed, 10 insertions, 6 deletions
diff --git a/gtk/ScintillaGTK.cxx b/gtk/ScintillaGTK.cxx index 8fbc58a10..675962e1d 100644 --- a/gtk/ScintillaGTK.cxx +++ b/gtk/ScintillaGTK.cxx @@ -659,7 +659,8 @@ void ScintillaGTK::GetSelection(GtkSelectionData *selection_data, guint info, ch } void ScintillaGTK::UnclaimSelection(GdkEventSelection *selection_event) { - if (selection_event->selection == GDK_SELECTION_PRIMARY) { + if ((selection_event->selection == GDK_SELECTION_PRIMARY) && + !OwnPrimarySelection()) { delete [] primarySelectionCopy; primarySelectionCopy = NULL; primarySelection = false; @@ -718,6 +719,10 @@ gint ScintillaGTK::MoveResize(GtkWidget *, GtkAllocation *allocation, ScintillaG gint ScintillaGTK::Press(GtkWidget *, GdkEventButton *event, ScintillaGTK *sciThis) { //Platform::DebugPrintf("Press %x time=%d state = %x button = %x\n",sciThis,event->time, event->state, event->button); + // Do not use GTK+ double click events as Scintilla has its own double click detection + if (event->type != GDK_BUTTON_PRESS) + return FALSE; + sciThis->evbtn = *event; Point pt; pt.x = int(event->x); diff --git a/src/Editor.cxx b/src/Editor.cxx index cec634363..e7e415c7b 100644 --- a/src/Editor.cxx +++ b/src/Editor.cxx @@ -117,7 +117,7 @@ Editor::~Editor() { } void Editor::Finalise() { - CancelModes(); + CancelModes(); } void Editor::DropGraphics() { @@ -1960,7 +1960,6 @@ void Editor::LineTranspose() { } void Editor::CancelModes() { - SetEmptySelection(currentPos); } int Editor::KeyCommand(UINT iMessage) { diff --git a/src/ScintillaBase.cxx b/src/ScintillaBase.cxx index d381b6739..0d5226f4d 100644 --- a/src/ScintillaBase.cxx +++ b/src/ScintillaBase.cxx @@ -283,11 +283,11 @@ void ScintillaBase::ContextMenu(Point pt) { void ScintillaBase::CancelModes() { AutoCompleteCancel(); ct.CallTipCancel(); - Editor::CancelModes(); + Editor::CancelModes(); } void ScintillaBase::ButtonDown(Point pt, unsigned int curTime, bool shift, bool ctrl, bool alt) { - CancelModes(); + CancelModes(); Editor::ButtonDown(pt, curTime, shift, ctrl, alt); } diff --git a/src/ScintillaBase.h b/src/ScintillaBase.h index 2e7402a1c..23d31dfd1 100644 --- a/src/ScintillaBase.h +++ b/src/ScintillaBase.h @@ -47,7 +47,7 @@ protected: virtual void AddCharUTF(char *s, unsigned int len); void Command(int cmdId); - virtual void CancelModes(); + virtual void CancelModes(); virtual int KeyCommand(UINT iMessage); void AutoCompleteStart(int lenEntered, const char *list); |