comparison src/xfns.c @ 9703:85ac0e4030d4

(x_window): Pass new arg f to hack_wm_protocols. (x_set_mouse_color, x_real_positions): Change calls to x_catch_errors and friends.
author Richard M. Stallman <rms@gnu.org>
date Wed, 26 Oct 1994 09:19:57 +0000
parents f6d4e1acb5a1
children fe7653791d28
comparison
equal deleted inserted replaced
9702:50dd719378b4 9703:85ac0e4030d4
865 #endif 865 #endif
866 Window tmp_root_window; 866 Window tmp_root_window;
867 Window *tmp_children; 867 Window *tmp_children;
868 int tmp_nchildren; 868 int tmp_nchildren;
869 869
870 x_catch_errors (f); 870 x_catch_errors (FRAME_X_DISPLAY (f));
871 while (1) 871 while (1)
872 { 872 {
873 XQueryTree (FRAME_X_DISPLAY (f), outer, &tmp_root_window, 873 XQueryTree (FRAME_X_DISPLAY (f), outer, &tmp_root_window,
874 &f->display.x->parent_desc, 874 &f->display.x->parent_desc,
875 &tmp_children, &tmp_nchildren); 875 &tmp_children, &tmp_nchildren);
904 /* It is possible for the window returned by the XQueryNotify 904 /* It is possible for the window returned by the XQueryNotify
905 to become invalid by the time we call XTranslateCoordinates. 905 to become invalid by the time we call XTranslateCoordinates.
906 That can happen when you restart some window managers. 906 That can happen when you restart some window managers.
907 If so, we get an error in XTranslateCoordinates. 907 If so, we get an error in XTranslateCoordinates.
908 Detect that and try the whole thing over. */ 908 Detect that and try the whole thing over. */
909 if (! x_had_errors_p (f)) 909 if (! x_had_errors_p (FRAME_X_DISPLAY (f)))
910 break; 910 break;
911 } 911 }
912 912
913 x_uncatch_errors (f); 913 x_uncatch_errors (FRAME_X_DISPLAY (f));
914 914
915 *xptr = f->display.x->left_pos - win_x; 915 *xptr = f->display.x->left_pos - win_x;
916 *yptr = f->display.x->top_pos - win_y; 916 *yptr = f->display.x->top_pos - win_y;
917 } 917 }
918 918
1089 f->display.x->mouse_pixel = f->display.x->foreground_pixel; 1089 f->display.x->mouse_pixel = f->display.x->foreground_pixel;
1090 1090
1091 BLOCK_INPUT; 1091 BLOCK_INPUT;
1092 1092
1093 /* It's not okay to crash if the user selects a screwy cursor. */ 1093 /* It's not okay to crash if the user selects a screwy cursor. */
1094 x_catch_errors (f); 1094 x_catch_errors (FRAME_X_DISPLAY (f));
1095 1095
1096 if (!EQ (Qnil, Vx_pointer_shape)) 1096 if (!EQ (Qnil, Vx_pointer_shape))
1097 { 1097 {
1098 CHECK_NUMBER (Vx_pointer_shape, 0); 1098 CHECK_NUMBER (Vx_pointer_shape, 0);
1099 cursor = XCreateFontCursor (FRAME_X_DISPLAY (f), XINT (Vx_pointer_shape)); 1099 cursor = XCreateFontCursor (FRAME_X_DISPLAY (f), XINT (Vx_pointer_shape));
1100 } 1100 }
1101 else 1101 else
1102 cursor = XCreateFontCursor (FRAME_X_DISPLAY (f), XC_xterm); 1102 cursor = XCreateFontCursor (FRAME_X_DISPLAY (f), XC_xterm);
1103 x_check_errors (f, "bad text pointer cursor: %s"); 1103 x_check_errors (FRAME_X_DISPLAY (f), "bad text pointer cursor: %s");
1104 1104
1105 if (!EQ (Qnil, Vx_nontext_pointer_shape)) 1105 if (!EQ (Qnil, Vx_nontext_pointer_shape))
1106 { 1106 {
1107 CHECK_NUMBER (Vx_nontext_pointer_shape, 0); 1107 CHECK_NUMBER (Vx_nontext_pointer_shape, 0);
1108 nontext_cursor = XCreateFontCursor (FRAME_X_DISPLAY (f), 1108 nontext_cursor = XCreateFontCursor (FRAME_X_DISPLAY (f),
1109 XINT (Vx_nontext_pointer_shape)); 1109 XINT (Vx_nontext_pointer_shape));
1110 } 1110 }
1111 else 1111 else
1112 nontext_cursor = XCreateFontCursor (FRAME_X_DISPLAY (f), XC_left_ptr); 1112 nontext_cursor = XCreateFontCursor (FRAME_X_DISPLAY (f), XC_left_ptr);
1113 x_check_errors (f, "bad nontext pointer cursor: %s"); 1113 x_check_errors (FRAME_X_DISPLAY (f), "bad nontext pointer cursor: %s");
1114 1114
1115 if (!EQ (Qnil, Vx_mode_pointer_shape)) 1115 if (!EQ (Qnil, Vx_mode_pointer_shape))
1116 { 1116 {
1117 CHECK_NUMBER (Vx_mode_pointer_shape, 0); 1117 CHECK_NUMBER (Vx_mode_pointer_shape, 0);
1118 mode_cursor = XCreateFontCursor (FRAME_X_DISPLAY (f), 1118 mode_cursor = XCreateFontCursor (FRAME_X_DISPLAY (f),
1119 XINT (Vx_mode_pointer_shape)); 1119 XINT (Vx_mode_pointer_shape));
1120 } 1120 }
1121 else 1121 else
1122 mode_cursor = XCreateFontCursor (FRAME_X_DISPLAY (f), XC_xterm); 1122 mode_cursor = XCreateFontCursor (FRAME_X_DISPLAY (f), XC_xterm);
1123 x_check_errors (f, "bad modeline pointer cursor: %s"); 1123 x_check_errors (FRAME_X_DISPLAY (f), "bad modeline pointer cursor: %s");
1124 1124
1125 if (!EQ (Qnil, Vx_sensitive_text_pointer_shape)) 1125 if (!EQ (Qnil, Vx_sensitive_text_pointer_shape))
1126 { 1126 {
1127 CHECK_NUMBER (Vx_sensitive_text_pointer_shape, 0); 1127 CHECK_NUMBER (Vx_sensitive_text_pointer_shape, 0);
1128 cross_cursor 1128 cross_cursor
1131 } 1131 }
1132 else 1132 else
1133 cross_cursor = XCreateFontCursor (FRAME_X_DISPLAY (f), XC_crosshair); 1133 cross_cursor = XCreateFontCursor (FRAME_X_DISPLAY (f), XC_crosshair);
1134 1134
1135 /* Check and report errors with the above calls. */ 1135 /* Check and report errors with the above calls. */
1136 x_check_errors (f, "can't set cursor shape: %s"); 1136 x_check_errors (FRAME_X_DISPLAY (f), "can't set cursor shape: %s");
1137 x_uncatch_errors (f); 1137 x_uncatch_errors (FRAME_X_DISPLAY (f));
1138 1138
1139 { 1139 {
1140 XColor fore_color, back_color; 1140 XColor fore_color, back_color;
1141 1141
1142 fore_color.pixel = f->display.x->mouse_pixel; 1142 fore_color.pixel = f->display.x->mouse_pixel;
2316 f->display.x->wm_hints.input = True; 2316 f->display.x->wm_hints.input = True;
2317 f->display.x->wm_hints.flags |= InputHint; 2317 f->display.x->wm_hints.flags |= InputHint;
2318 XSetWMHints (FRAME_X_DISPLAY (f), FRAME_X_WINDOW (f), 2318 XSetWMHints (FRAME_X_DISPLAY (f), FRAME_X_WINDOW (f),
2319 &f->display.x->wm_hints); 2319 &f->display.x->wm_hints);
2320 2320
2321 hack_wm_protocols (shell_widget); 2321 hack_wm_protocols (f, shell_widget);
2322 2322
2323 #ifdef HACK_EDITRES 2323 #ifdef HACK_EDITRES
2324 XtAddEventHandler (shell_widget, 0, True, _XEditResCheckMessages, 0); 2324 XtAddEventHandler (shell_widget, 0, True, _XEditResCheckMessages, 0);
2325 #endif 2325 #endif
2326 2326