test own pasting code
git-svn-id: https://geany.svn.sourceforge.net/svnroot/geany/trunk@418 ea778897-0a13-0410-b9d1-a72fbfd435f5
This commit is contained in:
parent
4b66194a4f
commit
4a8003f848
@ -972,7 +972,24 @@ on_editor_button_press_event (GtkWidget *widget,
|
||||
}
|
||||
#endif
|
||||
|
||||
//if (event->type == GDK_2BUTTON_PRESS) geany_debug("double click");
|
||||
// experimental code to simulate pasting by middle mouse button
|
||||
if (event->button == 2)
|
||||
{
|
||||
GtkClipboard *cp = gtk_clipboard_get(gdk_atom_intern("PRIMARY", FALSE));
|
||||
|
||||
if (gtk_clipboard_wait_is_text_available(cp))
|
||||
{
|
||||
gint idx = document_get_cur_idx();
|
||||
gchar *text = gtk_clipboard_wait_for_text(cp);
|
||||
|
||||
if (idx >= 0 && text != NULL)
|
||||
{
|
||||
sci_add_text(doc_list[idx].sci, text);
|
||||
g_free(text);
|
||||
return TRUE;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (event->button == 3)
|
||||
{
|
||||
|
Loading…
x
Reference in New Issue
Block a user