Edit menu selection causes clipboard text retreivel
Submitted by Ted X Toth
Link to original bug (#523010)
Description
Please describe the problem: Use of gtk_clipboard_request_text in edit_menu_activate_callback causes clipboard text to be retrieved unnecessarily prior to 'Paste' item selection which may never actually occur. Also if 'Paste' is selected the the owner of the clipboard will receive two selection-request-events for the text without a way to differentiate which is the actual paste.
Steps to reproduce: 1. 2. 3.
Actual results:
Expected results:
Does this happen every time?
Other information: This patch replaces the use of gtk_clipboard_request_text with gtk_clipboard_wait_is_text_available when the 'Edit' menu is selected. gtk_clipboard_wait_is_text_available will be a little faster as it doesn't retreive the text and selection or clipbord managers will only receive one selection-request-event for the data when the 'Paste' occurs if it ever does. Without this change selection-request-event listeners like selection or clipbord managers receive two selection-request-event one when the 'Edit' menu is selected and the other when 'Paste' is selected and there is no way to differnetiate them.
--- gnome-terminal-2.18.4/src/terminal-window.c 2008-03-17 11:30:21.000000000 -0500 +++ gnome-terminal-2.18.4.new/src/terminal-window.c 2008-03-17 11:29:47.000000000 -0500 @@ -753,7 +753,11 @@
window = (TerminalWindow *) user_data;
- gtk_clipboard_request_text (window->priv->clipboard, (GtkClipboardTextReceivedFunc) update_edit_menu, window);
- if (gtk_clipboard_wait_is_text_available (window->priv->clipboard))
-
update_edit_menu (window->priv->clipboard, "", window);
- else
-
update_edit_menu (window->priv->clipboard, NULL, window);
}
static void
Resolution: RESOLVED FIXED