diff options
Diffstat (limited to 'src/xmenu.c')
-rw-r--r-- | src/xmenu.c | 51 |
1 files changed, 48 insertions, 3 deletions
diff --git a/src/xmenu.c b/src/xmenu.c index 5a71d82a424..48320479ad8 100644 --- a/src/xmenu.c +++ b/src/xmenu.c @@ -41,10 +41,10 @@ Boston, MA 02110-1301, USA. */ #include <stdio.h> #include "lisp.h" -#include "termhooks.h" #include "keyboard.h" #include "keymap.h" #include "frame.h" +#include "termhooks.h" #include "window.h" #include "blockinput.h" #include "buffer.h" @@ -741,6 +741,9 @@ mouse_position_for_popup (f, x, y) Window root, dummy_window; int dummy; + if (! FRAME_X_P (f)) + abort (); + BLOCK_INPUT; XQueryPointer (FRAME_X_DISPLAY (f), @@ -936,6 +939,9 @@ no quit occurs and `x-popup-menu' returns nil. */) xpos += XINT (x); ypos += XINT (y); + if (! FRAME_X_P (f)) + error ("Can not put X menu on non-X terminal"); + XSETFRAME (Vmenu_updating_frame, f); } else @@ -1124,6 +1130,9 @@ for instance using the window manager, then this produces a quit and but I don't want to make one now. */ CHECK_WINDOW (window); + if (! FRAME_X_P (f)) + error ("Can not put X dialog on non-X terminal"); + #if ! defined (USE_X_TOOLKIT) && ! defined (USE_GTK) /* Display a menu with these alternatives in the middle of frame F. */ @@ -1451,6 +1460,9 @@ void x_activate_menubar (f) FRAME_PTR f; { + if (! FRAME_X_P (f)) + abort (); + if (!f->output_data.x->saved_menu_event->type) return; @@ -2090,9 +2102,14 @@ update_frame_menubar (f) #ifdef USE_GTK return xg_update_frame_menubar (f); #else - struct x_output *x = f->output_data.x; + struct x_output *x; int columns, rows; + if (! FRAME_X_P (f)) + abort (); + + x = f->output_data.x; + if (!x->menubar_widget || XtIsManaged (x->menubar_widget)) return 0; @@ -2138,7 +2155,7 @@ set_frame_menubar (f, first_time, deep_p) int first_time; int deep_p; { - xt_or_gtk_widget menubar_widget = f->output_data.x->menubar_widget; + xt_or_gtk_widget menubar_widget; #ifdef USE_X_TOOLKIT LWLIB_ID id; #endif @@ -2148,6 +2165,10 @@ set_frame_menubar (f, first_time, deep_p) int *submenu_start, *submenu_end; int *submenu_top_level_items, *submenu_n_panes; + if (! FRAME_X_P (f)) + abort (); + + menubar_widget = f->output_data.x->menubar_widget; XSETFRAME (Vmenu_updating_frame, f); @@ -2500,6 +2521,9 @@ free_frame_menubar (f) { Widget menubar_widget; + if (! FRAME_X_P (f)) + abort (); + menubar_widget = f->output_data.x->menubar_widget; f->output_data.x->menubar_height = 0; @@ -2652,6 +2676,9 @@ create_and_show_popup_menu (f, first_wv, x, y, for_click) struct next_popup_x_y popup_x_y; int specpdl_count = SPECPDL_INDEX (); + if (! FRAME_X_P (f)) + abort (); + xg_crazy_callback_abort = 1; menu = xg_create_widget ("popup", first_wv->name, f, first_wv, G_CALLBACK (popup_selection_callback), @@ -2760,6 +2787,9 @@ create_and_show_popup_menu (f, first_wv, x, y, for_click) LWLIB_ID menu_id; Widget menu; + if (! FRAME_X_P (f)) + abort (); + menu_id = widget_id_tick++; menu = lw_create_widget ("popup", first_wv->name, menu_id, first_wv, f->output_data.x->widget, 1, 0, @@ -2835,6 +2865,9 @@ xmenu_show (f, x, y, for_click, keymaps, title, error) int first_pane; + if (! FRAME_X_P (f)) + abort (); + *error = NULL; if (menu_items_used <= MENU_ITEMS_PANE_LENGTH) @@ -3117,6 +3150,9 @@ create_and_show_dialog (f, first_wv) { GtkWidget *menu; + if (! FRAME_X_P (f)) + abort (); + menu = xg_create_widget ("dialog", first_wv->name, f, first_wv, G_CALLBACK (dialog_selection_callback), G_CALLBACK (popup_deactivate_callback), @@ -3166,6 +3202,9 @@ create_and_show_dialog (f, first_wv) { LWLIB_ID dialog_id; + if (!FRAME_X_P (f)) + abort(); + dialog_id = widget_id_tick++; lw_create_widget (first_wv->name, "dialog", dialog_id, first_wv, f->output_data.x->widget, 1, 0, @@ -3217,6 +3256,9 @@ xdialog_show (f, keymaps, title, header, error_name) /* 1 means we've seen the boundary between left-hand elts and right-hand. */ int boundary_seen = 0; + if (! FRAME_X_P (f)) + abort (); + *error_name = NULL; if (menu_items_n_panes > 1) @@ -3484,6 +3526,9 @@ xmenu_show (f, x, y, for_click, keymaps, title, error) unsigned int dummy_uint; int specpdl_count = SPECPDL_INDEX (); + if (! FRAME_X_P (f)) + abort (); + *error = 0; if (menu_items_n_panes == 0) return Qnil; |