summaryrefslogtreecommitdiff
path: root/src/gui_motif.c
diff options
context:
space:
mode:
authorBram Moolenaar <Bram@vim.org>2022-03-24 18:04:49 +0000
committerBram Moolenaar <Bram@vim.org>2022-03-24 18:04:49 +0000
commit9dd42a631162a8561bd7c4b0e89afd21f7994d8c (patch)
tree550e6b027f0a11ce6ffe2d6b45ad1d8d00449e5d /src/gui_motif.c
parent1e2c4175dce903986dac66ba9326ae562b159421 (diff)
downloadvim-git-9dd42a631162a8561bd7c4b0e89afd21f7994d8c.tar.gz
patch 8.2.4621: crash when using the tabline right-click menuv8.2.4621
Problem: Crash when using the tabline right-click menu. Solution: Use XtPointer for XmNuserData. (closes #10009)
Diffstat (limited to 'src/gui_motif.c')
-rw-r--r--src/gui_motif.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/src/gui_motif.c b/src/gui_motif.c
index 740288827..56d3f3572 100644
--- a/src/gui_motif.c
+++ b/src/gui_motif.c
@@ -142,12 +142,12 @@ tabline_button_cb(
XtPointer client_data UNUSED,
XtPointer call_data UNUSED)
{
- int cmd, tab_idx;
+ XtPointer cmd, tab_idx;
XtVaGetValues(w, XmNuserData, &cmd, NULL);
XtVaGetValues(tabLine_menu, XmNuserData, &tab_idx, NULL);
- send_tabline_menu_event(tab_idx, cmd);
+ send_tabline_menu_event((int)(long)tab_idx, (int)(long)cmd);
}
/*
@@ -254,7 +254,7 @@ tabline_menu_cb(
XtVaGetValues(tab_w, XmNpageNumber, &tab_idx, NULL);
}
- XtVaSetValues(tabLine_menu, XmNuserData, tab_idx, NULL);
+ XtVaSetValues(tabLine_menu, XmNuserData, (XtPointer)(long)tab_idx, NULL);
XtVaGetValues(tabLine_menu, XmNchildren, &children, XmNnumChildren,
&numChildren, NULL);
XtManageChildren(children, numChildren);
@@ -517,7 +517,7 @@ gui_x11_create_widgets(void)
// Add the buttons to the tabline popup menu
n = 0;
- XtSetArg(args[n], XmNuserData, TABLINE_MENU_CLOSE); n++;
+ 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,7 +526,7 @@ gui_x11_create_widgets(void)
XmStringFree(xms);
n = 0;
- XtSetArg(args[n], XmNuserData, TABLINE_MENU_NEW); n++;
+ 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,7 +535,7 @@ gui_x11_create_widgets(void)
XmStringFree(xms);
n = 0;
- XtSetArg(args[n], XmNuserData, TABLINE_MENU_OPEN); n++;
+ 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);