To: vim_dev@googlegroups.com Subject: Patch 8.2.4621 Fcc: outbox From: Bram Moolenaar Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ------------ Patch 8.2.4621 Problem: Crash when using the tabline right-click menu. Solution: Use XtPointer for XmNuserData. (closes #10009) Files: src/gui_motif.c *** ../vim-8.2.4620/src/gui_motif.c 2022-03-13 14:44:59.396422421 +0000 --- src/gui_motif.c 2022-03-24 17:59:11.450028550 +0000 *************** *** 142,153 **** XtPointer client_data UNUSED, XtPointer call_data UNUSED) { ! int cmd, tab_idx; XtVaGetValues(w, XmNuserData, &cmd, NULL); XtVaGetValues(tabLine_menu, XmNuserData, &tab_idx, NULL); ! send_tabline_menu_event(tab_idx, cmd); } /* --- 142,153 ---- XtPointer client_data UNUSED, XtPointer call_data UNUSED) { ! XtPointer cmd, tab_idx; XtVaGetValues(w, XmNuserData, &cmd, NULL); XtVaGetValues(tabLine_menu, XmNuserData, &tab_idx, NULL); ! send_tabline_menu_event((int)(long)tab_idx, (int)(long)cmd); } /* *************** *** 254,260 **** XtVaGetValues(tab_w, XmNpageNumber, &tab_idx, NULL); } ! XtVaSetValues(tabLine_menu, XmNuserData, tab_idx, NULL); XtVaGetValues(tabLine_menu, XmNchildren, &children, XmNnumChildren, &numChildren, NULL); XtManageChildren(children, numChildren); --- 254,260 ---- XtVaGetValues(tab_w, XmNpageNumber, &tab_idx, NULL); } ! XtVaSetValues(tabLine_menu, XmNuserData, (XtPointer)(long)tab_idx, NULL); XtVaGetValues(tabLine_menu, XmNchildren, &children, XmNnumChildren, &numChildren, NULL); XtManageChildren(children, numChildren); *************** *** 517,523 **** // Add the buttons to the tabline popup menu n = 0; ! XtSetArg(args[n], XmNuserData, TABLINE_MENU_CLOSE); n++; xms = XmStringCreate((char *)"Close tab", STRING_TAG); XtSetArg(args[n], XmNlabelString, xms); n++; button = XmCreatePushButton(tabLine_menu, "Close", args, n); --- 517,523 ---- // Add the buttons to the tabline popup menu n = 0; ! XtSetArg(args[n], XmNuserData, (XtPointer)TABLINE_MENU_CLOSE); n++; xms = XmStringCreate((char *)"Close tab", STRING_TAG); XtSetArg(args[n], XmNlabelString, xms); n++; button = XmCreatePushButton(tabLine_menu, "Close", args, n); *************** *** 526,532 **** XmStringFree(xms); n = 0; ! XtSetArg(args[n], XmNuserData, TABLINE_MENU_NEW); n++; xms = XmStringCreate((char *)"New Tab", STRING_TAG); XtSetArg(args[n], XmNlabelString, xms); n++; button = XmCreatePushButton(tabLine_menu, "New Tab", args, n); --- 526,532 ---- XmStringFree(xms); n = 0; ! XtSetArg(args[n], XmNuserData, (XtPointer)TABLINE_MENU_NEW); n++; xms = XmStringCreate((char *)"New Tab", STRING_TAG); XtSetArg(args[n], XmNlabelString, xms); n++; button = XmCreatePushButton(tabLine_menu, "New Tab", args, n); *************** *** 535,541 **** XmStringFree(xms); n = 0; ! XtSetArg(args[n], XmNuserData, TABLINE_MENU_OPEN); n++; xms = XmStringCreate((char *)"Open tab...", STRING_TAG); XtSetArg(args[n], XmNlabelString, xms); n++; button = XmCreatePushButton(tabLine_menu, "Open tab...", args, n); --- 535,541 ---- XmStringFree(xms); n = 0; ! XtSetArg(args[n], XmNuserData, (XtPointer)TABLINE_MENU_OPEN); n++; xms = XmStringCreate((char *)"Open tab...", STRING_TAG); XtSetArg(args[n], XmNlabelString, xms); n++; button = XmCreatePushButton(tabLine_menu, "Open tab...", args, n); *** ../vim-8.2.4620/src/version.c 2022-03-24 15:24:41.702509705 +0000 --- src/version.c 2022-03-24 17:55:12.122301619 +0000 *************** *** 752,753 **** --- 752,755 ---- { /* Add new patch number below this line */ + /**/ + 4621, /**/ -- Have you heard about the new Barbie doll? It's called Divorce Barbie. It comes with most of Ken's stuff. /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net \\\ /// \\\ \\\ sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ /// \\\ help me help AIDS victims -- http://ICCF-Holland.org ///