diff --git a/unix/gtkcompat.h b/unix/gtkcompat.h index a218598d..ae25d7f5 100644 --- a/unix/gtkcompat.h +++ b/unix/gtkcompat.h @@ -65,6 +65,7 @@ #define gtk_adjustment_set_page_increment(a, val) ((a)->page_increment = (val)) #define gtk_adjustment_set_step_increment(a, val) ((a)->step_increment = (val)) #define gtk_adjustment_get_value(a) ((a)->value) +#define gtk_selection_data_get_selection(a) ((a)->selection) #define gtk_widget_set_has_window(w, b) \ gtk1_widget_set_unset_flag(w, GTK_NO_WINDOW, !(b)) @@ -83,6 +84,11 @@ * return the GDK default display. */ #define GDK_DISPLAY_XDISPLAY(x) GDK_DISPLAY() +#define GDK_KEY_C ('C') +#define GDK_KEY_V ('V') +#define GDK_KEY_c ('c') +#define GDK_KEY_v ('v') + #endif /* 2.0 */ #if !GTK_CHECK_VERSION(2,22,0) diff --git a/unix/gtkdlg.c b/unix/gtkdlg.c index 0cb8b7e0..a7efd3b4 100644 --- a/unix/gtkdlg.c +++ b/unix/gtkdlg.c @@ -3416,7 +3416,12 @@ GtkWidget *create_message_box( gtk_widget_show(window); gtk_window_set_focus(GTK_WINDOW(window), NULL); +#if !GTK_CHECK_VERSION(2,0,0) + dp->currtreeitem = NULL; + dp->treeitems = NULL; +#else dp->selparams = NULL; +#endif g_signal_connect(G_OBJECT(window), "destroy", G_CALLBACK(dlgparam_destroy), dp); diff --git a/unix/gtkwin.c b/unix/gtkwin.c index 5cfd5f44..d170fad7 100644 --- a/unix/gtkwin.c +++ b/unix/gtkwin.c @@ -51,6 +51,11 @@ #define NALLCOLOURS (NCFGCOLOURS + NEXTCOLOURS) GdkAtom compound_text_atom, utf8_string_atom; +GdkAtom clipboard_atom +#if GTK_CHECK_VERSION(2,0,0) /* GTK1 will have to fill this in at startup */ + = GDK_SELECTION_CLIPBOARD +#endif + ; #ifdef JUST_USE_GTK_CLIPBOARD_UTF8 /* @@ -2689,7 +2694,7 @@ void set_clipboard_atom(struct gui_data *inst, int clipboard, GdkAtom atom) int init_clipboard(struct gui_data *inst) { set_clipboard_atom(inst, CLIP_PRIMARY, GDK_SELECTION_PRIMARY); - set_clipboard_atom(inst, CLIP_CLIPBOARD, GDK_SELECTION_CLIPBOARD); + set_clipboard_atom(inst, CLIP_CLIPBOARD, clipboard_atom); return TRUE; } @@ -3233,7 +3238,7 @@ void init_clipboard(struct gui_data *inst) #endif inst->clipstates[CLIP_PRIMARY].atom = GDK_SELECTION_PRIMARY; - inst->clipstates[CLIP_CLIPBOARD].atom = GDK_SELECTION_CLIPBOARD; + inst->clipstates[CLIP_CLIPBOARD].atom = clipboard_atom; init_one_clipboard(inst, CLIP_PRIMARY); init_one_clipboard(inst, CLIP_CLIPBOARD); @@ -4999,6 +5004,8 @@ void new_session_window(Conf *conf, const char *geometry_string) compound_text_atom = gdk_atom_intern("COMPOUND_TEXT", FALSE); if (!utf8_string_atom) utf8_string_atom = gdk_atom_intern("UTF8_STRING", FALSE); + if (!clipboard_atom) + clipboard_atom = gdk_atom_intern("CLIPBOARD", FALSE); inst->area = gtk_drawing_area_new(); gtk_widget_set_name(GTK_WIDGET(inst->area), "drawing-area");