To: vim_dev@googlegroups.com Subject: Patch 8.2.1878 Fcc: outbox From: Bram Moolenaar Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ------------ Patch 8.2.1878 Problem: GTK: error for redefining function. (Tony Mechelynck) Solution: Remove "gtk_" prefix from local functions and prepend "gui_" to global functions. Files: src/gui_gtk_f.c, src/gui_gtk_f.h, src/gui_gtk.c, src/gui_gtk_x11.c *** ../vim-8.2.1877/src/gui_gtk_f.c 2020-10-21 12:37:56.270973451 +0200 --- src/gui_gtk_f.c 2020-10-21 16:08:48.386725805 +0200 *************** *** 11,17 **** * (C) 1998,1999 by Marcin Dalecki * * Support for GTK+ 2 was added by: - * * (C) 2002,2003 Jason Hildebrand * Daniel Elstner * --- 11,16 ---- *************** *** 21,27 **** * long time. * * Support for GTK+ 3 was added by: - * * 2016 Kazunobu Kuriyama */ --- 20,25 ---- *************** *** 50,101 **** }; ! static void gtk_form_class_init(GtkFormClass *klass); ! static void gtk_form_init(GtkForm *form, void *g_class); ! static void gtk_form_realize(GtkWidget *widget); ! static void gtk_form_unrealize(GtkWidget *widget); ! static void gtk_form_map(GtkWidget *widget); ! static void gtk_form_size_request(GtkWidget *widget, ! GtkRequisition *requisition); ! #if GTK_CHECK_VERSION(3,0,0) ! static void gtk_form_get_preferred_width(GtkWidget *widget, ! gint *minimal_width, ! gint *natural_width); ! static void gtk_form_get_preferred_height(GtkWidget *widget, ! gint *minimal_height, ! gint *natural_height); ! #endif ! static void gtk_form_size_allocate(GtkWidget *widget, ! GtkAllocation *allocation); ! #if GTK_CHECK_VERSION(3,0,0) ! static gboolean gtk_form_draw(GtkWidget *widget, ! cairo_t *cr); ! #else ! static gint gtk_form_expose(GtkWidget *widget, ! GdkEventExpose *event); ! #endif ! ! static void gtk_form_remove(GtkContainer *container, ! GtkWidget *widget); ! static void gtk_form_forall(GtkContainer *container, ! gboolean include_internals, ! GtkCallback callback, ! gpointer callback_data); ! ! static void gtk_form_attach_child_window(GtkForm *form, ! GtkFormChild *child); ! static void gtk_form_realize_child(GtkForm *form, ! GtkFormChild *child); ! static void gtk_form_position_child(GtkForm *form, ! GtkFormChild *child, ! gboolean force_allocate); ! static void gtk_form_position_children(GtkForm *form); ! static void gtk_form_send_configure(GtkForm *form); ! static void gtk_form_child_map(GtkWidget *widget, gpointer user_data); ! static void gtk_form_child_unmap(GtkWidget *widget, gpointer user_data); #if !GTK_CHECK_VERSION(3,0,0) static GtkWidgetClass *parent_class = NULL; --- 48,83 ---- }; ! static void form_class_init(GtkFormClass *klass); ! static void form_init(GtkForm *form, void *g_class); ! ! static void form_realize(GtkWidget *widget); ! static void form_unrealize(GtkWidget *widget); ! static void form_map(GtkWidget *widget); ! static void form_size_request(GtkWidget *widget, GtkRequisition *requisition); ! #if GTK_CHECK_VERSION(3,0,0) ! static void form_get_preferred_width(GtkWidget *widget, gint *minimal_width, gint *natural_width); ! static void form_get_preferred_height(GtkWidget *widget, gint *minimal_height, gint *natural_height); ! #endif ! static void form_size_allocate(GtkWidget *widget, GtkAllocation *allocation); ! #if GTK_CHECK_VERSION(3,0,0) ! static gboolean form_draw(GtkWidget *widget, cairo_t *cr); ! #else ! static gint form_expose(GtkWidget *widget, GdkEventExpose *event); ! #endif ! ! static void form_remove(GtkContainer *container, GtkWidget *widget); ! static void form_forall(GtkContainer *container, gboolean include_internals, GtkCallback callback, gpointer callback_data); ! static void form_attach_child_window(GtkForm *form, GtkFormChild *child); ! static void form_realize_child(GtkForm *form, GtkFormChild *child); ! static void form_position_child(GtkForm *form, GtkFormChild *child, gboolean force_allocate); ! static void form_position_children(GtkForm *form); ! static void form_send_configure(GtkForm *form); ! static void form_child_map(GtkWidget *widget, gpointer user_data); ! static void form_child_unmap(GtkWidget *widget, gpointer user_data); #if !GTK_CHECK_VERSION(3,0,0) static GtkWidgetClass *parent_class = NULL; *************** *** 104,127 **** // Public interface GtkWidget * ! gtk_form_new(void) { GtkForm *form; #if GTK_CHECK_VERSION(3,0,0) form = g_object_new(GTK_TYPE_FORM, NULL); #else ! form = gtk_type_new(gtk_form_get_type()); #endif return GTK_WIDGET(form); } void ! gtk_form_put(GtkForm *form, ! GtkWidget *child_widget, ! gint x, ! gint y) { GtkFormChild *child; --- 86,110 ---- // Public interface GtkWidget * ! gui_gtk_form_new(void) { GtkForm *form; #if GTK_CHECK_VERSION(3,0,0) form = g_object_new(GTK_TYPE_FORM, NULL); #else ! form = gtk_type_new(gui_gtk_form_get_type()); #endif return GTK_WIDGET(form); } void ! gui_gtk_form_put( ! GtkForm *form, ! GtkWidget *child_widget, ! gint x, ! gint y) { GtkFormChild *child; *************** *** 151,172 **** // that gtk_widget_set_parent() realizes the widget if it's visible // and its parent is mapped. if (gtk_widget_get_realized(GTK_WIDGET(form))) ! gtk_form_attach_child_window(form, child); gtk_widget_set_parent(child_widget, GTK_WIDGET(form)); if (gtk_widget_get_realized(GTK_WIDGET(form)) && !gtk_widget_get_realized(child_widget)) ! gtk_form_realize_child(form, child); ! gtk_form_position_child(form, child, TRUE); } void ! gtk_form_move(GtkForm *form, ! GtkWidget *child_widget, ! gint x, ! gint y) { GList *tmp_list; GtkFormChild *child; --- 134,156 ---- // that gtk_widget_set_parent() realizes the widget if it's visible // and its parent is mapped. if (gtk_widget_get_realized(GTK_WIDGET(form))) ! form_attach_child_window(form, child); gtk_widget_set_parent(child_widget, GTK_WIDGET(form)); if (gtk_widget_get_realized(GTK_WIDGET(form)) && !gtk_widget_get_realized(child_widget)) ! form_realize_child(form, child); ! form_position_child(form, child, TRUE); } void ! gui_gtk_form_move( ! GtkForm *form, ! GtkWidget *child_widget, ! gint x, ! gint y) { GList *tmp_list; GtkFormChild *child; *************** *** 181,194 **** child->x = x; child->y = y; ! gtk_form_position_child(form, child, TRUE); return; } } } void ! gtk_form_freeze(GtkForm *form) { g_return_if_fail(GTK_IS_FORM(form)); --- 165,178 ---- child->x = x; child->y = y; ! form_position_child(form, child, TRUE); return; } } } void ! gui_gtk_form_freeze(GtkForm *form) { g_return_if_fail(GTK_IS_FORM(form)); *************** *** 196,202 **** } void ! gtk_form_thaw(GtkForm *form) { g_return_if_fail(GTK_IS_FORM(form)); --- 180,186 ---- } void ! gui_gtk_form_thaw(GtkForm *form) { g_return_if_fail(GTK_IS_FORM(form)); *************** *** 204,210 **** { if (!(--form->freeze_count)) { ! gtk_form_position_children(form); gtk_widget_queue_draw(GTK_WIDGET(form)); } } --- 188,194 ---- { if (!(--form->freeze_count)) { ! form_position_children(form); gtk_widget_queue_draw(GTK_WIDGET(form)); } } *************** *** 215,221 **** G_DEFINE_TYPE(GtkForm, gtk_form, GTK_TYPE_CONTAINER) #else GtkType ! gtk_form_get_type(void) { static GtkType form_type = 0; --- 199,205 ---- G_DEFINE_TYPE(GtkForm, gtk_form, GTK_TYPE_CONTAINER) #else GtkType ! gui_gtk_form_get_type(void) { static GtkType form_type = 0; *************** *** 227,234 **** form_info.type_name = "GtkForm"; form_info.object_size = sizeof(GtkForm); form_info.class_size = sizeof(GtkFormClass); ! form_info.class_init_func = (GtkClassInitFunc)gtk_form_class_init; ! form_info.object_init_func = (GtkObjectInitFunc)gtk_form_init; form_type = gtk_type_unique(GTK_TYPE_CONTAINER, &form_info); } --- 211,218 ---- form_info.type_name = "GtkForm"; form_info.object_size = sizeof(GtkForm); form_info.class_size = sizeof(GtkFormClass); ! form_info.class_init_func = (GtkClassInitFunc)form_class_init; ! form_info.object_init_func = (GtkObjectInitFunc)form_init; form_type = gtk_type_unique(GTK_TYPE_CONTAINER, &form_info); } *************** *** 237,243 **** #endif // !GTK_CHECK_VERSION(3,0,0) static void ! gtk_form_class_init(GtkFormClass *klass) { GtkWidgetClass *widget_class; GtkContainerClass *container_class; --- 221,227 ---- #endif // !GTK_CHECK_VERSION(3,0,0) static void ! form_class_init(GtkFormClass *klass) { GtkWidgetClass *widget_class; GtkContainerClass *container_class; *************** *** 249,276 **** parent_class = gtk_type_class(gtk_container_get_type()); #endif ! widget_class->realize = gtk_form_realize; ! widget_class->unrealize = gtk_form_unrealize; ! widget_class->map = gtk_form_map; #if GTK_CHECK_VERSION(3,0,0) ! widget_class->get_preferred_width = gtk_form_get_preferred_width; ! widget_class->get_preferred_height = gtk_form_get_preferred_height; #else ! widget_class->size_request = gtk_form_size_request; #endif ! widget_class->size_allocate = gtk_form_size_allocate; #if GTK_CHECK_VERSION(3,0,0) ! widget_class->draw = gtk_form_draw; #else ! widget_class->expose_event = gtk_form_expose; #endif ! container_class->remove = gtk_form_remove; ! container_class->forall = gtk_form_forall; } static void ! gtk_form_init(GtkForm *form, void *g_class UNUSED) { #if GTK_CHECK_VERSION(3,0,0) gtk_widget_set_has_window(GTK_WIDGET(form), TRUE); --- 233,260 ---- parent_class = gtk_type_class(gtk_container_get_type()); #endif ! widget_class->realize = form_realize; ! widget_class->unrealize = form_unrealize; ! widget_class->map = form_map; #if GTK_CHECK_VERSION(3,0,0) ! widget_class->get_preferred_width = form_get_preferred_width; ! widget_class->get_preferred_height = form_get_preferred_height; #else ! widget_class->size_request = form_size_request; #endif ! widget_class->size_allocate = form_size_allocate; #if GTK_CHECK_VERSION(3,0,0) ! widget_class->draw = form_draw; #else ! widget_class->expose_event = form_expose; #endif ! container_class->remove = form_remove; ! container_class->forall = form_forall; } static void ! form_init(GtkForm *form, void *g_class UNUSED) { #if GTK_CHECK_VERSION(3,0,0) gtk_widget_set_has_window(GTK_WIDGET(form), TRUE); *************** *** 285,291 **** */ static void ! gtk_form_realize(GtkWidget *widget) { GList *tmp_list; GtkForm *form; --- 269,275 ---- */ static void ! form_realize(GtkWidget *widget) { GList *tmp_list; GtkForm *form; *************** *** 353,362 **** { GtkFormChild *child = tmp_list->data; ! gtk_form_attach_child_window(form, child); if (gtk_widget_get_visible(child->widget)) ! gtk_form_realize_child(form, child); } } --- 337,346 ---- { GtkFormChild *child = tmp_list->data; ! form_attach_child_window(form, child); if (gtk_widget_get_visible(child->widget)) ! form_realize_child(form, child); } } *************** *** 369,375 **** // Well, I reckon at least the gdk_window_show(form->bin_window) // is necessary. GtkForm is anything but a usual container widget. static void ! gtk_form_map(GtkWidget *widget) { GList *tmp_list; GtkForm *form; --- 353,359 ---- // Well, I reckon at least the gdk_window_show(form->bin_window) // is necessary. GtkForm is anything but a usual container widget. static void ! form_map(GtkWidget *widget) { GList *tmp_list; GtkForm *form; *************** *** 394,400 **** } static void ! gtk_form_unrealize(GtkWidget *widget) { GList *tmp_list; GtkForm *form; --- 378,384 ---- } static void ! form_unrealize(GtkWidget *widget) { GList *tmp_list; GtkForm *form; *************** *** 416,425 **** if (child->window != NULL) { g_signal_handlers_disconnect_by_func(G_OBJECT(child->widget), ! FUNC2GENERIC(gtk_form_child_map), child); g_signal_handlers_disconnect_by_func(G_OBJECT(child->widget), ! FUNC2GENERIC(gtk_form_child_unmap), child); gdk_window_set_user_data(child->window, NULL); --- 400,409 ---- if (child->window != NULL) { g_signal_handlers_disconnect_by_func(G_OBJECT(child->widget), ! FUNC2GENERIC(form_child_map), child); g_signal_handlers_disconnect_by_func(G_OBJECT(child->widget), ! FUNC2GENERIC(form_child_unmap), child); gdk_window_set_user_data(child->window, NULL); *************** *** 441,447 **** } static void ! gtk_form_size_request(GtkWidget *widget, GtkRequisition *requisition) { g_return_if_fail(GTK_IS_FORM(widget)); g_return_if_fail(requisition != NULL); --- 425,431 ---- } static void ! form_size_request(GtkWidget *widget, GtkRequisition *requisition) { g_return_if_fail(GTK_IS_FORM(widget)); g_return_if_fail(requisition != NULL); *************** *** 452,477 **** #if GTK_CHECK_VERSION(3,0,0) static void ! gtk_form_get_preferred_width(GtkWidget *widget, gint *minimal_width, gint *natural_width) { GtkRequisition requisition; ! gtk_form_size_request(widget, &requisition); *minimal_width = requisition.width; *natural_width = requisition.width; } static void ! gtk_form_get_preferred_height(GtkWidget *widget, gint *minimal_height, gint *natural_height) { GtkRequisition requisition; ! gtk_form_size_request(widget, &requisition); *minimal_height = requisition.height; *natural_height = requisition.height; --- 436,461 ---- #if GTK_CHECK_VERSION(3,0,0) static void ! form_get_preferred_width(GtkWidget *widget, gint *minimal_width, gint *natural_width) { GtkRequisition requisition; ! form_size_request(widget, &requisition); *minimal_width = requisition.width; *natural_width = requisition.width; } static void ! form_get_preferred_height(GtkWidget *widget, gint *minimal_height, gint *natural_height) { GtkRequisition requisition; ! form_size_request(widget, &requisition); *minimal_height = requisition.height; *natural_height = requisition.height; *************** *** 479,485 **** #endif // GTK_CHECK_VERSION(3,0,0) static void ! gtk_form_size_allocate(GtkWidget *widget, GtkAllocation *allocation) { GList *tmp_list; GtkForm *form; --- 463,469 ---- #endif // GTK_CHECK_VERSION(3,0,0) static void ! form_size_allocate(GtkWidget *widget, GtkAllocation *allocation) { GList *tmp_list; GtkForm *form; *************** *** 507,513 **** while (tmp_list) { GtkFormChild *child = tmp_list->data; ! gtk_form_position_child(form, child, TRUE); tmp_list = tmp_list->next; } --- 491,497 ---- while (tmp_list) { GtkFormChild *child = tmp_list->data; ! form_position_child(form, child, TRUE); tmp_list = tmp_list->next; } *************** *** 524,530 **** } gtk_widget_set_allocation(widget, allocation); if (need_reposition) ! gtk_form_send_configure(form); } #if GTK_CHECK_VERSION(3,0,0) --- 508,514 ---- } gtk_widget_set_allocation(widget, allocation); if (need_reposition) ! form_send_configure(form); } #if GTK_CHECK_VERSION(3,0,0) *************** *** 538,544 **** } static gboolean ! gtk_form_draw(GtkWidget *widget, cairo_t *cr) { GList *tmp_list = NULL; GtkForm *form = NULL; --- 522,528 ---- } static gboolean ! form_draw(GtkWidget *widget, cairo_t *cr) { GList *tmp_list = NULL; GtkForm *form = NULL; *************** *** 563,571 **** // gtk_widget_draw() fails and the relevant scrollbar won't // appear on the screen. // ! // Calling gtk_form_position_child() like this is one of ways // to make sure of that. ! gtk_form_position_child(form, formchild, TRUE); gtk_form_render_background(formchild->widget, cr); } --- 547,555 ---- // gtk_widget_draw() fails and the relevant scrollbar won't // appear on the screen. // ! // Calling form_position_child() like this is one of ways // to make sure of that. ! form_position_child(form, formchild, TRUE); gtk_form_render_background(formchild->widget, cr); } *************** *** 575,581 **** } #else // !GTK_CHECK_VERSION(3,0,0) static gint ! gtk_form_expose(GtkWidget *widget, GdkEventExpose *event) { GList *tmp_list; GtkForm *form; --- 559,565 ---- } #else // !GTK_CHECK_VERSION(3,0,0) static gint ! form_expose(GtkWidget *widget, GdkEventExpose *event) { GList *tmp_list; GtkForm *form; *************** *** 598,604 **** // Container method static void ! gtk_form_remove(GtkContainer *container, GtkWidget *widget) { GList *tmp_list; GtkForm *form; --- 582,588 ---- // Container method static void ! form_remove(GtkContainer *container, GtkWidget *widget) { GList *tmp_list; GtkForm *form; *************** *** 625,633 **** if (child->window) { g_signal_handlers_disconnect_by_func(G_OBJECT(child->widget), ! FUNC2GENERIC(>k_form_child_map), child); g_signal_handlers_disconnect_by_func(G_OBJECT(child->widget), ! FUNC2GENERIC(>k_form_child_unmap), child); // FIXME: This will cause problems for reparenting NO_WINDOW // widgets out of a GtkForm --- 609,617 ---- if (child->window) { g_signal_handlers_disconnect_by_func(G_OBJECT(child->widget), ! FUNC2GENERIC(&form_child_map), child); g_signal_handlers_disconnect_by_func(G_OBJECT(child->widget), ! FUNC2GENERIC(&form_child_unmap), child); // FIXME: This will cause problems for reparenting NO_WINDOW // widgets out of a GtkForm *************** *** 646,652 **** } static void ! gtk_form_forall(GtkContainer *container, gboolean include_internals UNUSED, GtkCallback callback, gpointer callback_data) --- 630,636 ---- } static void ! form_forall(GtkContainer *container, gboolean include_internals UNUSED, GtkCallback callback, gpointer callback_data) *************** *** 673,679 **** // Operations on children static void ! gtk_form_attach_child_window(GtkForm *form, GtkFormChild *child) { if (child->window != NULL) return; // been there, done that --- 657,663 ---- // Operations on children static void ! form_attach_child_window(GtkForm *form, GtkFormChild *child) { if (child->window != NULL) return; // been there, done that *************** *** 734,742 **** * alongside with the actual widget. */ g_signal_connect(G_OBJECT(child->widget), "map", ! G_CALLBACK(>k_form_child_map), child); g_signal_connect(G_OBJECT(child->widget), "unmap", ! G_CALLBACK(>k_form_child_unmap), child); } else if (!gtk_widget_get_realized(child->widget)) { --- 718,726 ---- * alongside with the actual widget. */ g_signal_connect(G_OBJECT(child->widget), "map", ! G_CALLBACK(&form_child_map), child); g_signal_connect(G_OBJECT(child->widget), "unmap", ! G_CALLBACK(&form_child_unmap), child); } else if (!gtk_widget_get_realized(child->widget)) { *************** *** 745,759 **** } static void ! gtk_form_realize_child(GtkForm *form, GtkFormChild *child) { ! gtk_form_attach_child_window(form, child); gtk_widget_realize(child->widget); } static void ! gtk_form_position_child(GtkForm *form, GtkFormChild *child, ! gboolean force_allocate) { gint x; gint y; --- 729,742 ---- } static void ! form_realize_child(GtkForm *form, GtkFormChild *child) { ! form_attach_child_window(form, child); gtk_widget_realize(child->widget); } static void ! form_position_child(GtkForm *form, GtkFormChild *child, gboolean force_allocate) { gint x; gint y; *************** *** 826,841 **** } static void ! gtk_form_position_children(GtkForm *form) { GList *tmp_list; for (tmp_list = form->children; tmp_list; tmp_list = tmp_list->next) ! gtk_form_position_child(form, tmp_list->data, FALSE); } void ! gtk_form_move_resize(GtkForm *form, GtkWidget *widget, gint x, gint y, gint w, gint h) { #if GTK_CHECK_VERSION(3,0,0) --- 809,824 ---- } static void ! form_position_children(GtkForm *form) { GList *tmp_list; for (tmp_list = form->children; tmp_list; tmp_list = tmp_list->next) ! form_position_child(form, tmp_list->data, FALSE); } void ! gui_gtk_form_move_resize(GtkForm *form, GtkWidget *widget, gint x, gint y, gint w, gint h) { #if GTK_CHECK_VERSION(3,0,0) *************** *** 845,855 **** widget->requisition.height = h; #endif ! gtk_form_move(form, widget, x, y); } static void ! gtk_form_send_configure(GtkForm *form) { GtkWidget *widget; GdkEventConfigure event; --- 828,838 ---- widget->requisition.height = h; #endif ! gui_gtk_form_move(form, widget, x, y); } static void ! form_send_configure(GtkForm *form) { GtkWidget *widget; GdkEventConfigure event; *************** *** 869,875 **** } static void ! gtk_form_child_map(GtkWidget *widget UNUSED, gpointer user_data) { GtkFormChild *child; --- 852,858 ---- } static void ! form_child_map(GtkWidget *widget UNUSED, gpointer user_data) { GtkFormChild *child; *************** *** 880,886 **** } static void ! gtk_form_child_unmap(GtkWidget *widget UNUSED, gpointer user_data) { GtkFormChild *child; --- 863,869 ---- } static void ! form_child_unmap(GtkWidget *widget UNUSED, gpointer user_data) { GtkFormChild *child; *** ../vim-8.2.1877/src/gui_gtk_f.h 2019-11-30 18:24:07.000000000 +0100 --- src/gui_gtk_f.h 2020-10-21 16:09:02.242682090 +0200 *************** *** 21,27 **** extern "C" { #endif ! #define GTK_TYPE_FORM (gtk_form_get_type ()) #ifdef USE_GTK3 #define GTK_FORM(obj) (G_TYPE_CHECK_INSTANCE_CAST((obj), GTK_TYPE_FORM, GtkForm)) #define GTK_FORM_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST((klass), GTK_TYPE_FORM, GtkFormClass)) --- 21,27 ---- extern "C" { #endif ! #define GTK_TYPE_FORM (gui_gtk_form_get_type ()) #ifdef USE_GTK3 #define GTK_FORM(obj) (G_TYPE_CHECK_INSTANCE_CAST((obj), GTK_TYPE_FORM, GtkForm)) #define GTK_FORM_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST((klass), GTK_TYPE_FORM, GtkFormClass)) *************** *** 53,81 **** }; #ifdef USE_GTK3 ! GType gtk_form_get_type(void); #else ! GtkType gtk_form_get_type(void); #endif ! GtkWidget *gtk_form_new(void); ! void gtk_form_put(GtkForm * form, GtkWidget * widget, ! gint x, gint y); ! void gtk_form_move(GtkForm *form, GtkWidget * widget, ! gint x, gint y); ! void gtk_form_move_resize(GtkForm * form, GtkWidget * widget, ! gint x, gint y, ! gint w, gint h); // These disable and enable moving and repainting respectively. If you // want to update the layout's offsets but do not want it to repaint // itself, you should use these functions. ! void gtk_form_freeze(GtkForm *form); ! void gtk_form_thaw(GtkForm *form); #ifdef __cplusplus --- 53,77 ---- }; #ifdef USE_GTK3 ! GType gui_gtk_form_get_type(void); #else ! GtkType gui_gtk_form_get_type(void); #endif ! GtkWidget *gui_gtk_form_new(void); ! void gui_gtk_form_put(GtkForm * form, GtkWidget * widget, gint x, gint y); ! void gui_gtk_form_move(GtkForm *form, GtkWidget * widget, gint x, gint y); ! void gui_gtk_form_move_resize(GtkForm * form, GtkWidget * widget, gint x, gint y, gint w, gint h); // These disable and enable moving and repainting respectively. If you // want to update the layout's offsets but do not want it to repaint // itself, you should use these functions. ! void gui_gtk_form_freeze(GtkForm *form); ! void gui_gtk_form_thaw(GtkForm *form); #ifdef __cplusplus *** ../vim-8.2.1877/src/gui_gtk.c 2020-09-09 20:58:52.008764176 +0200 --- src/gui_gtk.c 2020-10-21 16:06:49.331102500 +0200 *************** *** 810,816 **** void gui_mch_set_text_area_pos(int x, int y, int w, int h) { ! gtk_form_move_resize(GTK_FORM(gui.formwin), gui.drawarea, x, y, w, h); } --- 810,816 ---- void gui_mch_set_text_area_pos(int x, int y, int w, int h) { ! gui_gtk_form_move_resize(GTK_FORM(gui.formwin), gui.drawarea, x, y, w, h); } *************** *** 1005,1011 **** gui_mch_set_scrollbar_pos(scrollbar_T *sb, int x, int y, int w, int h) { if (sb->id != NULL) ! gtk_form_move_resize(GTK_FORM(gui.formwin), sb->id, x, y, w, h); } int --- 1005,1011 ---- gui_mch_set_scrollbar_pos(scrollbar_T *sb, int x, int y, int w, int h) { if (sb->id != NULL) ! gui_gtk_form_move_resize(GTK_FORM(gui.formwin), sb->id, x, y, w, h); } int *************** *** 1111,1117 **** GtkAdjustment *adjustment; gtk_widget_set_can_focus(sb->id, FALSE); ! gtk_form_put(GTK_FORM(gui.formwin), sb->id, 0, 0); adjustment = gtk_range_get_adjustment(GTK_RANGE(sb->id)); --- 1111,1117 ---- GtkAdjustment *adjustment; gtk_widget_set_can_focus(sb->id, FALSE); ! gui_gtk_form_put(GTK_FORM(gui.formwin), sb->id, 0, 0); adjustment = gtk_range_get_adjustment(GTK_RANGE(sb->id)); *** ../vim-8.2.1877/src/gui_gtk_x11.c 2020-10-07 16:12:33.905930345 +0200 --- src/gui_gtk_x11.c 2020-10-21 16:08:03.698866995 +0200 *************** *** 3811,3817 **** G_CALLBACK(on_tabline_menu), G_OBJECT(tabline_menu)); #endif // FEAT_GUI_TABLINE ! gui.formwin = gtk_form_new(); gtk_container_set_border_width(GTK_CONTAINER(gui.formwin), 0); #if !GTK_CHECK_VERSION(3,0,0) gtk_widget_set_events(gui.formwin, GDK_EXPOSURE_MASK); --- 3811,3817 ---- G_CALLBACK(on_tabline_menu), G_OBJECT(tabline_menu)); #endif // FEAT_GUI_TABLINE ! gui.formwin = gui_gtk_form_new(); gtk_container_set_border_width(GTK_CONTAINER(gui.formwin), 0); #if !GTK_CHECK_VERSION(3,0,0) gtk_widget_set_events(gui.formwin, GDK_EXPOSURE_MASK); *************** *** 3840,3846 **** GDK_POINTER_MOTION_HINT_MASK); gtk_widget_show(gui.drawarea); ! gtk_form_put(GTK_FORM(gui.formwin), gui.drawarea, 0, 0); gtk_widget_show(gui.formwin); gtk_box_pack_start(GTK_BOX(vbox), gui.formwin, TRUE, TRUE, 0); --- 3840,3846 ---- GDK_POINTER_MOTION_HINT_MASK); gtk_widget_show(gui.drawarea); ! gui_gtk_form_put(GTK_FORM(gui.formwin), gui.drawarea, 0, 0); gtk_widget_show(gui.formwin); gtk_box_pack_start(GTK_BOX(vbox), gui.formwin, TRUE, TRUE, 0); *************** *** 4119,4127 **** if (gtk_socket_id != 0) usable_height -= (gui.char_height - (gui.char_height/2)); // sic. ! gtk_form_freeze(GTK_FORM(gui.formwin)); gui_resize_shell(event->width, usable_height); ! gtk_form_thaw(GTK_FORM(gui.formwin)); return TRUE; } --- 4119,4127 ---- if (gtk_socket_id != 0) usable_height -= (gui.char_height - (gui.char_height/2)); // sic. ! gui_gtk_form_freeze(GTK_FORM(gui.formwin)); gui_resize_shell(event->width, usable_height); ! gui_gtk_form_thaw(GTK_FORM(gui.formwin)); return TRUE; } *** ../vim-8.2.1877/src/version.c 2020-10-21 14:49:05.033959899 +0200 --- src/version.c 2020-10-21 16:09:39.598564319 +0200 *************** *** 752,753 **** --- 752,755 ---- { /* Add new patch number below this line */ + /**/ + 1878, /**/ -- hundred-and-one symptoms of being an internet addict: 94. Now admit it... How many of you have made "modem noises" into the phone just to see if it was possible? :-) /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net \\\ /// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\ \\\ an exciting new programming language -- http://www.Zimbu.org /// \\\ help me help AIDS victims -- http://ICCF-Holland.org ///