Commit 8908491b authored by Jon Kåre Hellan's avatar Jon Kåre Hellan

Call wb_control_paste_from_selection without 'time' parameter.

* src/cmd-edit.c (cmd_paste): Call wb_control_paste_from_selection
without 'time' parameter.
(cmd_paste_to_selection): Call cmd_paste without 'time' parameter.

* src/item-cursor.c (item_cursor_do_action): Remove 'time'
parameter. Call cmd_paste without 'time' argument.
(context_menu_hander, item_cursor_do_drop): Call
item_cursor_do_action without 'time' argument.

* src/gui-clipboard.c
(x_clipboard_to_cell_region): Renamed from
x_selection_to_cell_region.
(x_clipboard_received): Renamed from
x_selection_received. 'widget' parameter replaced with
'clipboard', and 'time' parameter dropped. Call
gtk_clipboard_request_contents instead of gtk_selection_convert.
(x_clipboard_get_cb): Renamed from x_selection_handler. 'widget'
parameter replaced with 'clipboard', and 'time' parameter dropped.
Don't trust 'info' parameter. Gtk bug?
(x_clipboard_clear_cb): New function. Replaces x_selection_clear,
but even simpler.
(x_request_clipboard): Call gtk_clipboard_request_contents instead
of gtk_selection_convert.

* src/workbook-control.[ch], src/workbook-control-priv.h: Remove
'time' parameter from paste_from_selection method.

* src/workbook-control-component.c (wbcc_claim_selection): Remove.
(workbook_control_component_ctor_class): Inherit claim_selection
from superclass.

* src/workbook-control-gui.c (wbcg_paste_from_selection): Remove
'time' parameter and call x_request_clipboard without 'time'
parameter.
(wbcg_claim_selection): Replace old implementation with call to
new function x_claim_clipboard.
(workbook_control_gui_init): Remove call to
x_clipboard_bind_workbook.
parent 43021610
2002-05-13 Jon K Hellan <hellan@acm.org>
* src/cmd-edit.[ch] (cmd_paste): Remove 'time' parameter.
* src/cmd-edit.c (cmd_paste): Call wb_control_paste_from_selection
without 'time' parameter.
(cmd_paste_to_selection): Call cmd_paste without 'time' parameter.
* src/item-cursor.c (item_cursor_do_action): Remove 'time'
parameter. Call cmd_paste without 'time' argument.
(context_menu_hander, item_cursor_do_drop): Call
item_cursor_do_action without 'time' argument.
* src/gui-clipboard.[ch]: Switched to GtkClipboard API.
(x_request_clipboard): Remove 'time' parameter.
(x_clipboard_bind_workbook): Remove.
(x_claim_clipboard): New function. Claims ownership of primary and
clipboard.
* src/gui-clipboard.c
(x_clipboard_to_cell_region): Renamed from
x_selection_to_cell_region.
(x_clipboard_received): Renamed from
x_selection_received. 'widget' parameter replaced with
'clipboard', and 'time' parameter dropped. Call
gtk_clipboard_request_contents instead of gtk_selection_convert.
(x_clipboard_get_cb): Renamed from x_selection_handler. 'widget'
parameter replaced with 'clipboard', and 'time' parameter dropped.
Don't trust 'info' parameter. Gtk bug?
(x_clipboard_clear_cb): New function. Replaces x_selection_clear,
but even simpler.
(x_request_clipboard): Call gtk_clipboard_request_contents instead
of gtk_selection_convert.
* src/workbook-control.[ch], src/workbook-control-priv.h: Remove
'time' parameter from paste_from_selection method.
* src/workbook-control-component.c (wbcc_claim_selection): Remove.
(workbook_control_component_ctor_class): Inherit claim_selection
from superclass.
* src/workbook-control-gui.c (wbcg_paste_from_selection): Remove
'time' parameter and call x_request_clipboard without 'time'
parameter.
(wbcg_claim_selection): Replace old implementation with call to
new function x_claim_clipboard.
(workbook_control_gui_init): Remove call to
x_clipboard_bind_workbook.
2002-05-13 Andreas J. Guelzow <aguelzow@taliesin.ca>
* src/plugin.c (gnumeric_extra_plugin_dirs) : don't memorize the
......
2002-05-13 Jon K Hellan <hellan@acm.org>
* src/cmd-edit.[ch] (cmd_paste): Remove 'time' parameter.
* src/cmd-edit.c (cmd_paste): Call wb_control_paste_from_selection
without 'time' parameter.
(cmd_paste_to_selection): Call cmd_paste without 'time' parameter.
* src/item-cursor.c (item_cursor_do_action): Remove 'time'
parameter. Call cmd_paste without 'time' argument.
(context_menu_hander, item_cursor_do_drop): Call
item_cursor_do_action without 'time' argument.
* src/gui-clipboard.[ch]: Switched to GtkClipboard API.
(x_request_clipboard): Remove 'time' parameter.
(x_clipboard_bind_workbook): Remove.
(x_claim_clipboard): New function. Claims ownership of primary and
clipboard.
* src/gui-clipboard.c
(x_clipboard_to_cell_region): Renamed from
x_selection_to_cell_region.
(x_clipboard_received): Renamed from
x_selection_received. 'widget' parameter replaced with
'clipboard', and 'time' parameter dropped. Call
gtk_clipboard_request_contents instead of gtk_selection_convert.
(x_clipboard_get_cb): Renamed from x_selection_handler. 'widget'
parameter replaced with 'clipboard', and 'time' parameter dropped.
Don't trust 'info' parameter. Gtk bug?
(x_clipboard_clear_cb): New function. Replaces x_selection_clear,
but even simpler.
(x_request_clipboard): Call gtk_clipboard_request_contents instead
of gtk_selection_convert.
* src/workbook-control.[ch], src/workbook-control-priv.h: Remove
'time' parameter from paste_from_selection method.
* src/workbook-control-component.c (wbcc_claim_selection): Remove.
(workbook_control_component_ctor_class): Inherit claim_selection
from superclass.
* src/workbook-control-gui.c (wbcg_paste_from_selection): Remove
'time' parameter and call x_request_clipboard without 'time'
parameter.
(wbcg_claim_selection): Replace old implementation with call to
new function x_claim_clipboard.
(workbook_control_gui_init): Remove call to
x_clipboard_bind_workbook.
2002-05-13 Andreas J. Guelzow <aguelzow@taliesin.ca>
* src/plugin.c (gnumeric_extra_plugin_dirs) : don't memorize the
......
2002-05-13 Jon K Hellan <hellan@acm.org>
* src/cmd-edit.[ch] (cmd_paste): Remove 'time' parameter.
* src/cmd-edit.c (cmd_paste): Call wb_control_paste_from_selection
without 'time' parameter.
(cmd_paste_to_selection): Call cmd_paste without 'time' parameter.
* src/item-cursor.c (item_cursor_do_action): Remove 'time'
parameter. Call cmd_paste without 'time' argument.
(context_menu_hander, item_cursor_do_drop): Call
item_cursor_do_action without 'time' argument.
* src/gui-clipboard.[ch]: Switched to GtkClipboard API.
(x_request_clipboard): Remove 'time' parameter.
(x_clipboard_bind_workbook): Remove.
(x_claim_clipboard): New function. Claims ownership of primary and
clipboard.
* src/gui-clipboard.c
(x_clipboard_to_cell_region): Renamed from
x_selection_to_cell_region.
(x_clipboard_received): Renamed from
x_selection_received. 'widget' parameter replaced with
'clipboard', and 'time' parameter dropped. Call
gtk_clipboard_request_contents instead of gtk_selection_convert.
(x_clipboard_get_cb): Renamed from x_selection_handler. 'widget'
parameter replaced with 'clipboard', and 'time' parameter dropped.
Don't trust 'info' parameter. Gtk bug?
(x_clipboard_clear_cb): New function. Replaces x_selection_clear,
but even simpler.
(x_request_clipboard): Call gtk_clipboard_request_contents instead
of gtk_selection_convert.
* src/workbook-control.[ch], src/workbook-control-priv.h: Remove
'time' parameter from paste_from_selection method.
* src/workbook-control-component.c (wbcc_claim_selection): Remove.
(workbook_control_component_ctor_class): Inherit claim_selection
from superclass.
* src/workbook-control-gui.c (wbcg_paste_from_selection): Remove
'time' parameter and call x_request_clipboard without 'time'
parameter.
(wbcg_claim_selection): Replace old implementation with call to
new function x_claim_clipboard.
(workbook_control_gui_init): Remove call to
x_clipboard_bind_workbook.
2002-05-13 Andreas J. Guelzow <aguelzow@taliesin.ca>
* src/plugin.c (gnumeric_extra_plugin_dirs) : don't memorize the
......
......@@ -270,7 +270,7 @@ cmd_select_cur_inputs (Sheet *sheet)
* Full undo support.
*/
void
cmd_paste (WorkbookControl *wbc, PasteTarget const *pt, guint32 time)
cmd_paste (WorkbookControl *wbc, PasteTarget const *pt)
{
CellRegion *content;
Range const *src_range;
......@@ -325,7 +325,7 @@ cmd_paste (WorkbookControl *wbc, PasteTarget const *pt, guint32 time)
/* See if the control has access to information to paste */
else
wb_control_paste_from_selection (wbc, pt, time);
wb_control_paste_from_selection (wbc, pt);
}
/**
......@@ -350,7 +350,7 @@ cmd_paste_to_selection (WorkbookControl *wbc, Sheet *dest_sheet, int paste_flags
pt.sheet = dest_sheet;
pt.range = *r;
pt.paste_flags = paste_flags;
cmd_paste (wbc, &pt, GDK_CURRENT_TIME);
cmd_paste (wbc, &pt);
}
/**
......
......@@ -10,8 +10,7 @@ void cmd_select_cur_depends (Sheet *sheet);
void cmd_select_cur_inputs (Sheet *sheet);
void cmd_paste_to_selection (WorkbookControl *context, Sheet *sheet, int flags);
void cmd_paste (WorkbookControl *context, PasteTarget const *pt,
guint32 time);
void cmd_paste (WorkbookControl *context, PasteTarget const *pt);
void cmd_shift_cols (WorkbookControl *context, Sheet *sheet,
int start_col, int end_col,
......
......@@ -38,7 +38,8 @@
#define TARGETS_ATOM_NAME "TARGETS"
static CellRegion *
x_selection_to_cell_region (WorkbookControlGUI *wbcg, const guchar *src, int len)
x_clipboard_to_cell_region (WorkbookControlGUI *wbcg,
const guchar *src, int len)
{
DialogStfResult_t *dialogresult;
CellRegion *cr = NULL;
......@@ -137,13 +138,13 @@ x_selection_to_cell_region (WorkbookControlGUI *wbcg, const guchar *src, int len
}
/**
* x_selection_received:
* x_clipboard_received:
*
* Invoked when the selection has been received by our application.
* This is triggered by a call we do to gtk_selection_convert.
* This is triggered by a call we do to gtk_clipboard_request_contents.
*/
static void
x_selection_received (GtkWidget *widget, GtkSelectionData *sel, guint time,
x_clipboard_received (GtkClipboard *clipboard, GtkSelectionData *sel,
WorkbookControlGUI *wbcg)
{
GdkAtom atom_targets = gdk_atom_intern (TARGETS_ATOM_NAME, FALSE);
......@@ -158,7 +159,6 @@ x_selection_received (GtkWidget *widget, GtkSelectionData *sel, guint time,
if (sel->target == atom_targets) { /* The data is a list of atoms */
GdkAtom *atoms = (GdkAtom *) sel->data;
gboolean gnumeric_format, html_format;
GtkWidget *toplevel;
int atom_count = (sel->length / sizeof (GdkAtom));
int i;
......@@ -181,9 +181,9 @@ x_selection_received (GtkWidget *widget, GtkSelectionData *sel, guint time,
html_format = TRUE;
/* NOTE : We don't release the date resources
* (wbcg->clipboard_paste_callback_data), the
* reason for this is that we will actually call ourself
* again (indirectly through the gtk_selection_convert
* (wbcg->clipboard_paste_callback_data), the reason for
* this is that we will actually call ourself again
* (indirectly through the gtk_clipboard_request_contents
* and that call _will_ free the data (and also needs it).
* So we won't release anything.
*/
......@@ -192,21 +192,24 @@ x_selection_received (GtkWidget *widget, GtkSelectionData *sel, guint time,
* request the data in gnumeric XML format. If not, just
* request it in string format
*/
toplevel = GTK_WIDGET (wbcg_toplevel (wbcg));
if (gnumeric_format)
gtk_selection_convert (toplevel,
GDK_SELECTION_PRIMARY,
atom_gnumeric, time);
#if 0
gtk_clipboard_request_contents
(clipboard, atom_gnumeric,
(GtkClipboardReceivedFunc)
x_clipboard_received,
wbcg);
else if (html_format)
gtk_selection_convert (toplevel,
GDK_SELECTION_PRIMARY,
atom_html, time);
#endif
gtk_clipboard_request_contents
(clipboard, atom_html,
(GtkClipboardReceivedFunc)
x_clipboard_received,
wbcg);
else
gtk_selection_convert (toplevel,
GDK_SELECTION_PRIMARY,
GDK_SELECTION_TYPE_STRING, time);
gtk_clipboard_request_contents
(clipboard, GDK_SELECTION_TYPE_STRING,
(GtkClipboardReceivedFunc)
x_clipboard_received,
wbcg);
} else if (sel->target == atom_gnumeric) {
/* The data is the gnumeric specific XML interchange format */
......@@ -219,7 +222,7 @@ x_selection_received (GtkWidget *widget, GtkSelectionData *sel, guint time,
free_closure = TRUE;
/* Did X provide any selection? */
if (sel->length > 0)
content = x_selection_to_cell_region (wbcg, sel->data, sel->length);
content = x_clipboard_to_cell_region (wbcg, sel->data, sel->length);
}
if (content != NULL) {
......@@ -245,13 +248,13 @@ x_selection_received (GtkWidget *widget, GtkSelectionData *sel, guint time,
}
/**
* x_selection_handler:
* x_clipboard_get_cb
*
* Callback invoked when another application requests we render the selection.
*/
static void
x_selection_handler (GtkWidget *widget, GtkSelectionData *selection_data,
guint info, guint time, WorkbookControl *wbc)
x_clipboard_get_cb (GtkClipboard *gclipboard, GtkSelectionData *selection_data,
guint info, WorkbookControl *wbc)
{
gboolean to_gnumeric = FALSE, content_needs_free = FALSE;
CellRegion *clipboard = application_clipboard_contents_get ();
......@@ -286,7 +289,13 @@ x_selection_handler (GtkWidget *widget, GtkSelectionData *selection_data,
* in fact we only have to check the 'info' variable, however
* to be absolutely sure I check if the atom checks out too
*/
if (selection_data->target == atom_gnumeric && info == GNUMERIC_ATOM_INFO) {
if (selection_data->target == atom_gnumeric
#if 0
/* The 'info' parameter is junk with gtk_clipboard_set_with_owner
on gtk 2.0 */
&& info == GNUMERIC_ATOM_INFO
#endif
) {
int buffer_size;
xmlChar *buffer = xml_cellregion_write (wbc, clipboard, &buffer_size);
gtk_selection_data_set (selection_data, GDK_SELECTION_TYPE_STRING, 8,
......@@ -322,25 +331,26 @@ x_selection_handler (GtkWidget *widget, GtkSelectionData *selection_data,
}
/**
* x_selection_clear:
* x_clipboard_clear_cb:
*
* Callback for the "we lost the X selection" signal
* Callback for the "we lost the X selection" signal. Only invoked for
* "primary".
*/
static gint
x_selection_clear (GtkWidget *widget, GdkEventSelection *event,
WorkbookControl *wbc)
x_clipboard_clear_cb (GtkClipboard *clipboard,
gpointer data)
{
/* we have already lost the selection, no need to clear it */
if (event->selection == GDK_SELECTION_PRIMARY)
application_clipboard_clear (FALSE);
application_clipboard_clear (FALSE);
return TRUE;
}
void
x_request_clipboard (WorkbookControlGUI *wbcg, PasteTarget const *pt, guint32 time)
x_request_clipboard (WorkbookControlGUI *wbcg, PasteTarget const *pt)
{
PasteTarget *new_pt;
GtkClipboard *primary = gtk_clipboard_get (GDK_SELECTION_PRIMARY);
GdkAtom atom_targets = gdk_atom_intern (TARGETS_ATOM_NAME, FALSE);
if (wbcg->clipboard_paste_callback_data != NULL)
g_free (wbcg->clipboard_paste_callback_data);
......@@ -349,55 +359,34 @@ x_request_clipboard (WorkbookControlGUI *wbcg, PasteTarget const *pt, guint32 ti
*new_pt = *pt;
wbcg->clipboard_paste_callback_data = new_pt;
/* Query the formats, This will callback x_selection_received */
gtk_selection_convert (
GTK_WIDGET (wbcg_toplevel (wbcg)),
GDK_SELECTION_PRIMARY,
gdk_atom_intern (TARGETS_ATOM_NAME, FALSE), time);
/* Query the formats, This will callback x_clipboard_received */
gtk_clipboard_request_contents
(primary, atom_targets,
(GtkClipboardReceivedFunc) x_clipboard_received,
wbcg);
}
/**
* x_clipboard_bind_workbook:
*
* Binds the signals related to the X selection to the Workbook
* and initialized the clipboard data structures for the Workbook.
*/
int
x_clipboard_bind_workbook (WorkbookControlGUI *wbcg)
gboolean
x_claim_clipboard (WorkbookControlGUI *wbcg)
{
GtkWidget *toplevel = GTK_WIDGET (wbcg_toplevel (wbcg));
GtkTargetEntry targets;
wbcg->clipboard_paste_callback_data = NULL;
g_signal_connect (G_OBJECT (toplevel),
"selection_clear_event",
G_CALLBACK (x_selection_clear), wbcg);
g_signal_connect (G_OBJECT (toplevel),
"selection_received",
G_CALLBACK (x_selection_received), wbcg);
g_signal_connect (G_OBJECT (toplevel),
"selection_get",
G_CALLBACK (x_selection_handler), wbcg);
gtk_selection_add_target (toplevel,
GDK_SELECTION_PRIMARY, GDK_SELECTION_TYPE_STRING, 0);
gtk_selection_add_target (toplevel,
GDK_SELECTION_CLIPBOARD, GDK_SELECTION_TYPE_STRING, 0);
/*
* Our specific Gnumeric XML clipboard interchange type
*/
targets.target = (char *)GNUMERIC_ATOM_NAME;
/* This is not useful, but we have to set it to something: */
targets.flags = GTK_TARGET_SAME_WIDGET;
targets.info = GNUMERIC_ATOM_INFO;
gtk_selection_add_targets (toplevel,
GDK_SELECTION_PRIMARY, &targets, 1);
gtk_selection_add_targets (toplevel,
GDK_SELECTION_CLIPBOARD, &targets, 1);
return FALSE;
gboolean clipboard_owner_set;
gboolean primary_owner_set;
static const GtkTargetEntry targets[] = {
{(char *) GNUMERIC_ATOM_NAME, GTK_TARGET_SAME_WIDGET,
GNUMERIC_ATOM_INFO},
{ (char *)"STRING", 0, 0 },
};
GtkClipboard *clipboard = gtk_clipboard_get (GDK_SELECTION_CLIPBOARD);
GtkClipboard *primary = gtk_clipboard_get (GDK_SELECTION_PRIMARY);
clipboard_owner_set = gtk_clipboard_set_with_owner
(clipboard, targets, G_N_ELEMENTS (targets),
(GtkClipboardGetFunc) x_clipboard_get_cb,
NULL, G_OBJECT (wbcg));
primary_owner_set = gtk_clipboard_set_with_owner
(primary, targets, G_N_ELEMENTS (targets),
(GtkClipboardGetFunc) x_clipboard_get_cb,
(GtkClipboardClearFunc) x_clipboard_clear_cb,
G_OBJECT (wbcg));
return clipboard_owner_set || primary_owner_set;
}
......@@ -3,8 +3,7 @@
#include "gui-gnumeric.h"
int x_clipboard_bind_workbook (WorkbookControlGUI *wbcg);
void x_request_clipboard (WorkbookControlGUI *wbcg,
PasteTarget const *pt, guint32 time);
void x_request_clipboard (WorkbookControlGUI *wbcg, PasteTarget const *pt);
gboolean x_claim_clipboard (WorkbookControlGUI *wbcg);
#endif /* GNUMERIC_GUI_CLIPBOARD_H */
......@@ -921,7 +921,7 @@ typedef enum {
} ActionType;
static void
item_cursor_do_action (ItemCursor *ic, ActionType action, guint32 time)
item_cursor_do_action (ItemCursor *ic, ActionType action)
{
SheetControl *sc;
Sheet *sheet;
......@@ -945,8 +945,7 @@ item_cursor_do_action (ItemCursor *ic, ActionType action, guint32 time)
break;
cmd_paste (wbc,
paste_target_init (&pt, sheet, &ic->pos,
PASTE_ALL_TYPES),
time);
PASTE_ALL_TYPES));
break;
case ACTION_MOVE_CELLS:
......@@ -954,8 +953,7 @@ item_cursor_do_action (ItemCursor *ic, ActionType action, guint32 time)
break;
cmd_paste (wbc,
paste_target_init (&pt, sheet, &ic->pos,
PASTE_ALL_TYPES),
time);
PASTE_ALL_TYPES));
break;
case ACTION_COPY_FORMATS:
......@@ -963,8 +961,7 @@ item_cursor_do_action (ItemCursor *ic, ActionType action, guint32 time)
break;
cmd_paste (wbc,
paste_target_init (&pt, sheet, &ic->pos,
PASTE_FORMATS),
time);
PASTE_FORMATS));
break;
case ACTION_COPY_VALUES:
......@@ -972,8 +969,7 @@ item_cursor_do_action (ItemCursor *ic, ActionType action, guint32 time)
break;
cmd_paste (wbc,
paste_target_init (&pt, sheet, &ic->pos,
PASTE_AS_VALUES),
time);
PASTE_AS_VALUES));
break;
case ACTION_SHIFT_DOWN_AND_COPY:
......@@ -996,7 +992,7 @@ context_menu_hander (GnumericPopupMenuElement const *element,
{
g_return_val_if_fail (element != NULL, TRUE);
item_cursor_do_action (ic, element->index, GDK_CURRENT_TIME);
item_cursor_do_action (ic, element->index);
return TRUE;
}
......@@ -1059,8 +1055,8 @@ item_cursor_do_drop (ItemCursor *ic, GdkEventButton *event)
item_cursor_popup_menu (ic, event);
else
item_cursor_do_action (ic, (event->state & GDK_CONTROL_MASK)
? ACTION_COPY_CELLS : ACTION_MOVE_CELLS,
event->time);
? ACTION_COPY_CELLS
: ACTION_MOVE_CELLS);
}
static void
......
......@@ -144,16 +144,6 @@ wbcc_menu_state_sheet_count (WorkbookControl *wbc) {}
static void
wbcc_menu_state_sensitivity (WorkbookControl *wbc, gboolean sensitive) {}
/* FIXME: Can this be made to work? */
static gboolean
wbcc_claim_selection (WorkbookControl *wbc)
{
WorkbookControlGUI *wbcg = (WorkbookControlGUI *)wbc;
return gtk_selection_owner_set (GTK_WIDGET (wbcg->table),
GDK_SELECTION_PRIMARY,
GDK_CURRENT_TIME);
}
static int
wbcc_validation_msg (WorkbookControl *wbc, ValidationStyle v,
char const *title, char const *msg)
......@@ -348,7 +338,7 @@ workbook_control_component_ctor_class (GObjectClass *object_class)
wbc_class->menu_state.sensitivity = wbcc_menu_state_sensitivity;
wbc_class->menu_state.sheet_count = wbcc_menu_state_sheet_count;
wbc_class->claim_selection = wbcc_claim_selection;
/* wbc_class->claim_selection inherited from wbcg */
/* wbc_class->paste_from_selection inherited from wbcg */
wbc_class->validation_msg = wbcc_validation_msg;
wbcg_class->set_transient = wbcc_set_transient_for;
......
......@@ -1156,21 +1156,15 @@ wbcg_menu_state_sheet_count (WorkbookControl *wbc)
}
static void
wbcg_paste_from_selection (WorkbookControl *wbc, PasteTarget const *pt, guint32 time)
wbcg_paste_from_selection (WorkbookControl *wbc, PasteTarget const *pt)
{
x_request_clipboard ((WorkbookControlGUI *)wbc, pt, time);
x_request_clipboard ((WorkbookControlGUI *)wbc, pt);
}
static gboolean
wbcg_claim_selection (WorkbookControl *wbc)
{
WorkbookControlGUI *wbcg = (WorkbookControlGUI *)wbc;
gboolean clipboard_owner_set = gtk_selection_owner_set (GTK_WIDGET (wbcg->toplevel),
GDK_SELECTION_CLIPBOARD,
GDK_CURRENT_TIME);
return gtk_selection_owner_set (GTK_WIDGET (wbcg->toplevel),
GDK_SELECTION_PRIMARY,
GDK_CURRENT_TIME) || clipboard_owner_set;
return x_claim_clipboard ((WorkbookControlGUI *)wbc);
}
static void
......@@ -4711,11 +4705,6 @@ workbook_control_gui_init (WorkbookControlGUI *wbcg,
/* Postpone showing the GUI, so that we may resize it freely. */
gtk_idle_add ((GtkFunction) show_gui, wbcg);
/* Postpone clipboard setup. For mysterious reasons, connecting
callbacks to the table doesn't work. toplevel does work, but we
must wait until we live inside a toplevel. */
gtk_idle_add ((GtkFunction) x_clipboard_bind_workbook, wbcg);
}
static int
......
......@@ -54,7 +54,7 @@ typedef struct {
gboolean (*claim_selection) (WorkbookControl *wbc);
void (*paste_from_selection) (WorkbookControl *wbc,
PasteTarget const *pt, guint32 time);
PasteTarget const *pt);
int (*validation_msg) (WorkbookControl *wbc, ValidationStyle v,
char const *title, char const *msg);
} WorkbookControlClass;
......
......@@ -116,8 +116,7 @@ WBC_VIRTUAL_FULL (menu_state_sheet_count, menu_state.sheet_count,
(WorkbookControl *wbc), (wbc))
WBC_VIRTUAL (paste_from_selection,
(WorkbookControl *wbc, PasteTarget const *pt, guint32 time),
(wbc, pt, time))
(WorkbookControl *wbc, PasteTarget const *pt), (wbc, pt))
void
wb_control_sheet_add (WorkbookControl *wbc, Sheet *new_sheet)
......
......@@ -75,7 +75,7 @@ void wb_control_menu_state_sensitivity (WorkbookControl *wbc, gboolean sensitive
void wb_control_menu_state_sheet_count (WorkbookControl *wbc);
void wb_control_paste_from_selection (WorkbookControl *wbc,
PasteTarget const *pt, guint32 time);
PasteTarget const *pt);
gboolean wb_control_claim_selection (WorkbookControl *wbc);
WorkbookView *wb_control_view (WorkbookControl *wbc);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment