mirror of
https://git.tartarus.org/simon/putty.git
synced 2025-01-10 01:48:00 +00:00
GTK1 build fixes.
Looks as if I haven't retried the GTK1 build for a while, and recent GTK frontend development has broken it. The selection revamp has pointed out that GTK1 didn't have the accessor function gtk_selection_data_get_selection(), the standard GdkAtom value GDK_SELECTION_CLIPBOARD, or keysyms for alphabetic characters; and also I had an initialisation of one of my own structure fields (dp->selparams) accidentally not guarded by the same GTK-versioning ifdef that controls whether or not it was defined.
This commit is contained in:
parent
31a2017af5
commit
0476ceaa08
@ -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)
|
||||
|
@ -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);
|
||||
|
@ -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");
|
||||
|
Loading…
Reference in New Issue
Block a user