fix 536 (primary clipboard destroyed when moving around)
This commit is contained in:
parent
898d6ba3c0
commit
45437c764d
4 changed files with 51 additions and 3 deletions
|
@ -1,3 +1,10 @@
|
|||
2004-07-18 [colin] 0.9.12cvs31.5
|
||||
|
||||
* src/compose.c
|
||||
Fix trashing the primary clipboard when moving
|
||||
around with tab
|
||||
(Fix Bug 536 Unintuitive: "To:" copied to clipboard)
|
||||
|
||||
2004-07-18 [colin] 0.9.12cvs31.4
|
||||
|
||||
* src/codeconv.c
|
||||
|
|
|
@ -41,3 +41,4 @@
|
|||
( cvs diff -u -r 1.96.2.11 -r 1.96.2.12 src/textview.c; ) > 0.9.12cvs31.2.patchset
|
||||
( cvs diff -u -r 1.382.2.23 -r 1.382.2.24 src/compose.c; ) > 0.9.12cvs31.3.patchset
|
||||
( cvs diff -u -r 1.65.2.6 -r 1.65.2.7 src/codeconv.c; ) > 0.9.12cvs31.4.patchset
|
||||
( cvs diff -u -r 1.382.2.24 -r 1.382.2.25 src/compose.c; ) > 0.9.12cvs31.5.patchset
|
||||
|
|
|
@ -13,7 +13,7 @@ INTERFACE_AGE=0
|
|||
BINARY_AGE=0
|
||||
EXTRA_VERSION=31
|
||||
EXTRA_RELEASE=
|
||||
EXTRA_GTK2_VERSION=.4
|
||||
EXTRA_GTK2_VERSION=.5
|
||||
|
||||
if test \( $EXTRA_VERSION -eq 0 \) -o \( "x$EXTRA_RELEASE" != "x" \); then
|
||||
VERSION=${MAJOR_VERSION}.${MINOR_VERSION}.${MICRO_VERSION}${EXTRA_RELEASE}${EXTRA_GTK2_VERSION}
|
||||
|
|
|
@ -374,7 +374,9 @@ static void compose_allsel_cb (Compose *compose);
|
|||
static void compose_advanced_action_cb (Compose *compose,
|
||||
ComposeCallAdvancedAction action);
|
||||
|
||||
static void compose_grab_focus_cb (GtkWidget *widget,
|
||||
static gboolean compose_grab_focus_cb (GtkWidget *widget,
|
||||
Compose *compose);
|
||||
static gboolean compose_grab_focus_before_cb (GtkWidget *widget,
|
||||
Compose *compose);
|
||||
|
||||
static void compose_changed_cb (GtkTextBuffer *textbuf,
|
||||
|
@ -4739,6 +4741,10 @@ static void compose_create_header_entry(Compose *compose)
|
|||
}
|
||||
if (header)
|
||||
gtk_entry_set_text(GTK_ENTRY(GTK_COMBO(combo)->entry), header);
|
||||
g_signal_connect(G_OBJECT(GTK_COMBO(combo)->entry), "grab_focus",
|
||||
G_CALLBACK(compose_grab_focus_before_cb), compose);
|
||||
g_signal_connect_after(G_OBJECT(GTK_COMBO(combo)->entry), "grab_focus",
|
||||
G_CALLBACK(compose_grab_focus_cb), compose);
|
||||
|
||||
/* Entry field */
|
||||
entry = gtk_entry_new();
|
||||
|
@ -4754,6 +4760,8 @@ static void compose_create_header_entry(Compose *compose)
|
|||
g_signal_connect(G_OBJECT(entry), "activate",
|
||||
G_CALLBACK(text_activated), compose);
|
||||
g_signal_connect(G_OBJECT(entry), "grab_focus",
|
||||
G_CALLBACK(compose_grab_focus_before_cb), compose);
|
||||
g_signal_connect_after(G_OBJECT(entry), "grab_focus",
|
||||
G_CALLBACK(compose_grab_focus_cb), compose);
|
||||
g_signal_connect(G_OBJECT(entry), "button-press-event",
|
||||
G_CALLBACK(compose_headerentry_button_pressed),
|
||||
|
@ -5003,6 +5011,8 @@ static GtkWidget *compose_create_others(Compose *compose)
|
|||
gtk_table_attach_defaults(GTK_TABLE(table), savemsg_entry, 1, 2, rowcount, rowcount + 1);
|
||||
gtk_editable_set_editable(GTK_EDITABLE(savemsg_entry), prefs_common.savemsg);
|
||||
g_signal_connect(G_OBJECT(savemsg_entry), "grab_focus",
|
||||
G_CALLBACK(compose_grab_focus_before_cb), compose);
|
||||
g_signal_connect_after(G_OBJECT(savemsg_entry), "grab_focus",
|
||||
G_CALLBACK(compose_grab_focus_cb), compose);
|
||||
if (account_get_special_folder(compose->account, F_OUTBOX)) {
|
||||
folderidentifier = folder_item_get_identifier(account_get_special_folder
|
||||
|
@ -5179,6 +5189,8 @@ static Compose *compose_create(PrefsAccount *account, ComposeMode mode)
|
|||
g_signal_connect(G_OBJECT(subject_entry), "activate",
|
||||
G_CALLBACK(text_activated), compose);
|
||||
g_signal_connect(G_OBJECT(subject_entry), "grab_focus",
|
||||
G_CALLBACK(compose_grab_focus_before_cb), compose);
|
||||
g_signal_connect_after(G_OBJECT(subject_entry), "grab_focus",
|
||||
G_CALLBACK(compose_grab_focus_cb), compose);
|
||||
gtk_widget_show(subject_entry);
|
||||
compose->subject_entry = subject_entry;
|
||||
|
@ -7197,10 +7209,38 @@ static void compose_advanced_action_cb(Compose *compose,
|
|||
}
|
||||
}
|
||||
|
||||
static void compose_grab_focus_cb(GtkWidget *widget, Compose *compose)
|
||||
static gchar *cliptext = NULL;
|
||||
|
||||
static gboolean compose_grab_focus_before_cb(GtkWidget *widget, Compose *compose)
|
||||
{
|
||||
gchar *str = NULL;
|
||||
GtkClipboard *clip = gtk_clipboard_get(gdk_atom_intern("PRIMARY", FALSE));
|
||||
if (cliptext)
|
||||
g_free(cliptext);
|
||||
if (gtk_clipboard_wait_is_text_available(clip))
|
||||
cliptext = gtk_clipboard_wait_for_text(clip);
|
||||
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
static gboolean compose_grab_focus_cb(GtkWidget *widget, Compose *compose)
|
||||
{
|
||||
gchar *str = NULL;
|
||||
GtkClipboard *clip = gtk_clipboard_get(gdk_atom_intern("PRIMARY", FALSE));
|
||||
|
||||
if (GTK_IS_EDITABLE(widget)) {
|
||||
str = gtk_editable_get_chars(GTK_EDITABLE(widget), 0, -1);
|
||||
gtk_editable_set_position(GTK_EDITABLE(widget),
|
||||
strlen(str));
|
||||
g_free(str);
|
||||
}
|
||||
if (cliptext)
|
||||
gtk_clipboard_set_text(clip, cliptext, -1);
|
||||
|
||||
if (GTK_IS_EDITABLE(widget) || GTK_IS_TEXT_VIEW(widget))
|
||||
compose->focused_editable = widget;
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
static void compose_changed_cb(GtkTextBuffer *textbuf, Compose *compose)
|
||||
|
|
Loading…
Reference in a new issue