diff options
Diffstat (limited to 'src/xfns.c')
| -rw-r--r-- | src/xfns.c | 30 |
1 files changed, 13 insertions, 17 deletions
diff --git a/src/xfns.c b/src/xfns.c index 8de4c8bfd9e..ebe51b70a56 100644 --- a/src/xfns.c +++ b/src/xfns.c | |||
| @@ -1230,13 +1230,10 @@ x_set_mouse_color (struct frame *f, Lisp_Object arg, Lisp_Object oldval) | |||
| 1230 | for (i = 0; i < mouse_cursor_max; i++) | 1230 | for (i = 0; i < mouse_cursor_max; i++) |
| 1231 | { | 1231 | { |
| 1232 | Lisp_Object shape_var = *mouse_cursor_types[i].shape_var_ptr; | 1232 | Lisp_Object shape_var = *mouse_cursor_types[i].shape_var_ptr; |
| 1233 | if (!NILP (shape_var)) | 1233 | cursor_data.cursor_num[i] |
| 1234 | { | 1234 | = (!NILP (shape_var) |
| 1235 | CHECK_TYPE_RANGED_INTEGER (unsigned, shape_var); | 1235 | ? check_uinteger_max (shape_var, UINT_MAX) |
| 1236 | cursor_data.cursor_num[i] = XFIXNUM (shape_var); | 1236 | : mouse_cursor_types[i].default_shape); |
| 1237 | } | ||
| 1238 | else | ||
| 1239 | cursor_data.cursor_num[i] = mouse_cursor_types[i].default_shape; | ||
| 1240 | } | 1237 | } |
| 1241 | 1238 | ||
| 1242 | block_input (); | 1239 | block_input (); |
| @@ -1801,10 +1798,7 @@ x_change_tool_bar_height (struct frame *f, int height) | |||
| 1801 | static void | 1798 | static void |
| 1802 | x_set_internal_border_width (struct frame *f, Lisp_Object arg, Lisp_Object oldval) | 1799 | x_set_internal_border_width (struct frame *f, Lisp_Object arg, Lisp_Object oldval) |
| 1803 | { | 1800 | { |
| 1804 | int border; | 1801 | int border = check_int_nonnegative (arg); |
| 1805 | |||
| 1806 | CHECK_TYPE_RANGED_INTEGER (int, arg); | ||
| 1807 | border = max (XFIXNUM (arg), 0); | ||
| 1808 | 1802 | ||
| 1809 | if (border != FRAME_INTERNAL_BORDER_WIDTH (f)) | 1803 | if (border != FRAME_INTERNAL_BORDER_WIDTH (f)) |
| 1810 | { | 1804 | { |
| @@ -3376,10 +3370,12 @@ x_icon (struct frame *f, Lisp_Object parms) | |||
| 3376 | = gui_frame_get_and_record_arg (f, parms, Qicon_left, 0, 0, RES_TYPE_NUMBER); | 3370 | = gui_frame_get_and_record_arg (f, parms, Qicon_left, 0, 0, RES_TYPE_NUMBER); |
| 3377 | Lisp_Object icon_y | 3371 | Lisp_Object icon_y |
| 3378 | = gui_frame_get_and_record_arg (f, parms, Qicon_top, 0, 0, RES_TYPE_NUMBER); | 3372 | = gui_frame_get_and_record_arg (f, parms, Qicon_top, 0, 0, RES_TYPE_NUMBER); |
| 3373 | int icon_xval, icon_yval; | ||
| 3374 | |||
| 3379 | if (!EQ (icon_x, Qunbound) && !EQ (icon_y, Qunbound)) | 3375 | if (!EQ (icon_x, Qunbound) && !EQ (icon_y, Qunbound)) |
| 3380 | { | 3376 | { |
| 3381 | CHECK_TYPE_RANGED_INTEGER (int, icon_x); | 3377 | icon_xval = check_integer_range (icon_x, INT_MIN, INT_MAX); |
| 3382 | CHECK_TYPE_RANGED_INTEGER (int, icon_y); | 3378 | icon_yval = check_integer_range (icon_y, INT_MIN, INT_MAX); |
| 3383 | } | 3379 | } |
| 3384 | else if (!EQ (icon_x, Qunbound) || !EQ (icon_y, Qunbound)) | 3380 | else if (!EQ (icon_x, Qunbound) || !EQ (icon_y, Qunbound)) |
| 3385 | error ("Both left and top icon corners of icon must be specified"); | 3381 | error ("Both left and top icon corners of icon must be specified"); |
| @@ -3387,7 +3383,7 @@ x_icon (struct frame *f, Lisp_Object parms) | |||
| 3387 | block_input (); | 3383 | block_input (); |
| 3388 | 3384 | ||
| 3389 | if (! EQ (icon_x, Qunbound)) | 3385 | if (! EQ (icon_x, Qunbound)) |
| 3390 | x_wm_set_icon_position (f, XFIXNUM (icon_x), XFIXNUM (icon_y)); | 3386 | x_wm_set_icon_position (f, icon_xval, icon_yval); |
| 3391 | 3387 | ||
| 3392 | #if false /* gui_display_get_arg removes the visibility parameter as a | 3388 | #if false /* gui_display_get_arg removes the visibility parameter as a |
| 3393 | side effect, but x_create_frame still needs it. */ | 3389 | side effect, but x_create_frame still needs it. */ |
| @@ -5550,12 +5546,12 @@ The coordinates X and Y are interpreted in pixels relative to a position | |||
| 5550 | if (FRAME_INITIAL_P (f) || !FRAME_X_P (f)) | 5546 | if (FRAME_INITIAL_P (f) || !FRAME_X_P (f)) |
| 5551 | return Qnil; | 5547 | return Qnil; |
| 5552 | 5548 | ||
| 5553 | CHECK_TYPE_RANGED_INTEGER (int, x); | 5549 | int xval = check_integer_range (x, INT_MIN, INT_MAX); |
| 5554 | CHECK_TYPE_RANGED_INTEGER (int, y); | 5550 | int yval = check_integer_range (y, INT_MIN, INT_MAX); |
| 5555 | 5551 | ||
| 5556 | block_input (); | 5552 | block_input (); |
| 5557 | XWarpPointer (FRAME_X_DISPLAY (f), None, DefaultRootWindow (FRAME_X_DISPLAY (f)), | 5553 | XWarpPointer (FRAME_X_DISPLAY (f), None, DefaultRootWindow (FRAME_X_DISPLAY (f)), |
| 5558 | 0, 0, 0, 0, XFIXNUM (x), XFIXNUM (y)); | 5554 | 0, 0, 0, 0, xval, yval); |
| 5559 | unblock_input (); | 5555 | unblock_input (); |
| 5560 | 5556 | ||
| 5561 | return Qnil; | 5557 | return Qnil; |