Branch: refs/heads/master Author: Colomban Wendling ban@herbesfolles.org Committer: Colomban Wendling ban@herbesfolles.org Date: Sat, 25 May 2013 15:48:49 UTC Commit: 0dc9e4ec382e8057753c3debea4b4462e0a6944d https://github.com/geany/geany/commit/0dc9e4ec382e8057753c3debea4b4462e0a694...
Log Message: ----------- Import fix from upstream Scintilla to fix crash upon DnD with GTK3
This imports Scintilla commit e488315f2d30e1795f0899779bac948da41b4eef from HG, "Bug: [#1481]. Incorrect event copying on GTK+ 3.x."
Modified Paths: -------------- scintilla/gtk/ScintillaGTK.cxx
Modified: scintilla/gtk/ScintillaGTK.cxx 19 files changed, 14 insertions(+), 5 deletions(-) =================================================================== @@ -122,7 +122,7 @@ class ScintillaGTK : public ScintillaBase {
SelectionText primary;
- GdkEventButton evbtn; + GdkEventButton *evbtn; bool capturedMouse; bool dragWasDropped; int lastKey; @@ -354,7 +354,7 @@ static ScintillaGTK *ScintillaFromWidget(GtkWidget *widget) { ScintillaGTK::ScintillaGTK(_ScintillaObject *sci_) : adjustmentv(0), adjustmenth(0), scrollBarWidth(30), scrollBarHeight(30), - capturedMouse(false), dragWasDropped(false), + evbtn(0), capturedMouse(false), dragWasDropped(false), lastKey(0), rectangularSelectionModifier(SCMOD_CTRL), parentClass(0), im_context(NULL), lastWheelMouseDirection(0), @@ -392,6 +392,10 @@ static ScintillaGTK *ScintillaFromWidget(GtkWidget *widget) {
ScintillaGTK::~ScintillaGTK() { g_idle_remove_by_data(this); + if (evbtn) { + gdk_event_free(reinterpret_cast<GdkEvent *>(evbtn)); + evbtn = 0; + } }
static void UnRefCursor(GdkCursor *cursor) { @@ -824,14 +828,15 @@ bool ScintillaGTK::DragThreshold(Point ptStart, Point ptNow) { }
void ScintillaGTK::StartDrag() { + PLATFORM_ASSERT(evbtn != 0); dragWasDropped = false; inDragDrop = ddDragging; GtkTargetList *tl = gtk_target_list_new(clipboardCopyTargets, nClipboardCopyTargets); gtk_drag_begin(GTK_WIDGET(PWidget(wMain)), tl, static_cast<GdkDragAction>(GDK_ACTION_COPY | GDK_ACTION_MOVE), - evbtn.button, - reinterpret_cast<GdkEvent *>(&evbtn)); + evbtn->button, + reinterpret_cast<GdkEvent *>(evbtn)); }
static std::string ConvertText(char *s, size_t len, const char *charSetDest, @@ -1761,7 +1766,11 @@ gint ScintillaGTK::PressThis(GdkEventButton *event) { if (event->type != GDK_BUTTON_PRESS) return FALSE;
- evbtn = *event; + if (evbtn) { + gdk_event_free(reinterpret_cast<GdkEvent *>(evbtn)); + evbtn = 0; + } + evbtn = reinterpret_cast<GdkEventButton *>(gdk_event_copy(reinterpret_cast<GdkEvent *>(event))); Point pt; pt.x = int(event->x); pt.y = int(event->y);
-------------- This E-Mail was brought to you by github_commit_mail.py (Source: https://github.com/geany/infrastructure).