# HG changeset patch # User Richard M. Stallman # Date 1008975336 0 # Node ID 35dd407f04cd8e6785b9f95376aa22225859ff34 # Parent adee81b7bad285a2d7a80056c8f6a7ea7eb43f94 (compute_tip_xy): If tooltip won't fit on the screen to the left or to the right of the pointer, put it against the left screen edge. diff -r adee81b7bad2 -r 35dd407f04cd src/xfns.c --- a/src/xfns.c Fri Dec 21 19:38:25 2001 +0000 +++ b/src/xfns.c Fri Dec 21 22:55:36 2001 +0000 @@ -11126,10 +11126,15 @@ if (INTEGERP (left)) *root_x = XINT (left); - else if (*root_x + XINT (dx) + width > FRAME_X_DISPLAY_INFO (f)->width) + else if (*root_x + XINT (dx) + width <= FRAME_X_DISPLAY_INFO (f)->width) + /* It fits to the right of the pointer. */ + *root_x += XINT (dx); + else if (width + XINT (dx) <= *root_x) + /* It fits to the left of the pointer. */ *root_x -= width + XINT (dx); else - *root_x += XINT (dx); + /* Put it left-justified on the screen--it ought to fit that way. */ + *root_x = 0; }