aboutsummaryrefslogtreecommitdiffstats
path: root/oldXMenu
diff options
context:
space:
mode:
Diffstat (limited to 'oldXMenu')
-rw-r--r--oldXMenu/Create.c2
-rw-r--r--oldXMenu/Internal.c31
-rw-r--r--oldXMenu/XMakeAssoc.c2
3 files changed, 16 insertions, 19 deletions
diff --git a/oldXMenu/Create.c b/oldXMenu/Create.c
index 7eb17c508d5..e209bbeceeb 100644
--- a/oldXMenu/Create.c
+++ b/oldXMenu/Create.c
@@ -598,6 +598,8 @@ XMenuCreate(Display *display, Window parent, register char const *def_env)
598 * Create pane, active, and inactive GC's. 598 * Create pane, active, and inactive GC's.
599 */ 599 */
600 values = (XGCValues *)malloc(sizeof(XGCValues)); 600 values = (XGCValues *)malloc(sizeof(XGCValues));
601 if (!values)
602 return NULL;
601 valuemask = (GCForeground | GCBackground | GCFont | GCLineWidth); 603 valuemask = (GCForeground | GCBackground | GCFont | GCLineWidth);
602 604
603 /* 605 /*
diff --git a/oldXMenu/Internal.c b/oldXMenu/Internal.c
index f489e27beab..3e97f9ab3f1 100644
--- a/oldXMenu/Internal.c
+++ b/oldXMenu/Internal.c
@@ -534,7 +534,6 @@ _XMRecomputePane(register Display *display, register XMenu *menu, register XMPan
534 register int window_y; /* Recomputed window Y coordinate. */ 534 register int window_y; /* Recomputed window Y coordinate. */
535 535
536 unsigned long change_mask; /* Value mask to reconfigure window. */ 536 unsigned long change_mask; /* Value mask to reconfigure window. */
537 XWindowChanges *changes; /* Values to use in configure window. */
538 537
539 register Bool config_p = False; /* Reconfigure pane window? */ 538 register Bool config_p = False; /* Reconfigure pane window? */
540 539
@@ -612,21 +611,19 @@ _XMRecomputePane(register Display *display, register XMenu *menu, register XMPan
612 * it for creation with the new configuration. 611 * it for creation with the new configuration.
613 */ 612 */
614 if (p_ptr->window) { 613 if (p_ptr->window) {
614 XWindowChanges changes;
615 change_mask = (CWX | CWY | CWWidth | CWHeight); 615 change_mask = (CWX | CWY | CWWidth | CWHeight);
616 changes = (XWindowChanges *)malloc(sizeof(XWindowChanges)); 616 changes.x = p_ptr->window_x;
617 changes->x = p_ptr->window_x; 617 changes.y = p_ptr->window_y;
618 changes->y = p_ptr->window_y; 618 changes.width = p_ptr->window_w;
619 changes->width = p_ptr->window_w; 619 changes.height = p_ptr->window_h;
620 changes->height = p_ptr->window_h;
621 620
622 XConfigureWindow( 621 XConfigureWindow(
623 display, 622 display,
624 p_ptr->window, 623 p_ptr->window,
625 change_mask, 624 change_mask,
626 changes 625 &changes
627 ); 626 );
628 free(changes);
629
630 } 627 }
631 else { 628 else {
632 if (_XMWinQueAddPane(display, menu, p_ptr) == _FAILURE) { 629 if (_XMWinQueAddPane(display, menu, p_ptr) == _FAILURE) {
@@ -681,7 +678,6 @@ _XMRecomputeSelection(register Display *display, register XMenu *menu, register
681 /* Selection sequence number. */ 678 /* Selection sequence number. */
682{ 679{
683 register Bool config_s = False; /* Reconfigure selection window? */ 680 register Bool config_s = False; /* Reconfigure selection window? */
684 XWindowChanges *changes; /* Values to change in configure. */
685 unsigned long change_mask; /* Value mask for XConfigureWindow. */ 681 unsigned long change_mask; /* Value mask for XConfigureWindow. */
686 682
687 /* 683 /*
@@ -738,22 +734,19 @@ _XMRecomputeSelection(register Display *display, register XMenu *menu, register
738 * for creation with the new configuration. 734 * for creation with the new configuration.
739 */ 735 */
740 if (s_ptr->window) { 736 if (s_ptr->window) {
741 changes = (XWindowChanges *)malloc(sizeof(XWindowChanges)); 737 XWindowChanges changes;
742 change_mask = (CWX | CWY | CWWidth | CWHeight); 738 change_mask = (CWX | CWY | CWWidth | CWHeight);
743 changes = (XWindowChanges *)malloc(sizeof(XWindowChanges)); 739 changes.x = s_ptr->window_x;
744 changes->x = s_ptr->window_x; 740 changes.y = s_ptr->window_y;
745 changes->y = s_ptr->window_y; 741 changes.width = s_ptr->window_w;
746 changes->width = s_ptr->window_w; 742 changes.height = s_ptr->window_h;
747 changes->height = s_ptr->window_h;
748 743
749 XConfigureWindow( 744 XConfigureWindow(
750 display, 745 display,
751 s_ptr->window, 746 s_ptr->window,
752 change_mask, 747 change_mask,
753 changes 748 &changes
754 ); 749 );
755 free(changes);
756
757 } 750 }
758 else { 751 else {
759 if (_XMWinQueAddSelection(display, menu, s_ptr) == _FAILURE) { 752 if (_XMWinQueAddSelection(display, menu, s_ptr) == _FAILURE) {
diff --git a/oldXMenu/XMakeAssoc.c b/oldXMenu/XMakeAssoc.c
index 9bbde2cf94d..2530e8e507b 100644
--- a/oldXMenu/XMakeAssoc.c
+++ b/oldXMenu/XMakeAssoc.c
@@ -69,6 +69,8 @@ XMakeAssoc(register Display *dpy, register XAssocTable *table, register XID x_id
69 /* before the current value of "Entry". */ 69 /* before the current value of "Entry". */
70 /* Create a new XAssoc and load it with new provided data. */ 70 /* Create a new XAssoc and load it with new provided data. */
71 new_entry = (XAssoc *) malloc(sizeof(XAssoc)); 71 new_entry = (XAssoc *) malloc(sizeof(XAssoc));
72 if (!new_entry)
73 return; /* This obsolete API has no way to report failure! */
72 new_entry->display = dpy; 74 new_entry->display = dpy;
73 new_entry->x_id = x_id; 75 new_entry->x_id = x_id;
74 new_entry->data = data; 76 new_entry->data = data;