comparison src/xterm.c @ 16352:dfe3713f8c75

(XTflash): Don't flash in the internal borders. or between a scroll bar and the edge. (XTflash): Flash just top and bottom screen line. (XTread_socket): Finish previous change.
author Richard M. Stallman <rms@gnu.org>
date Fri, 27 Sep 1996 07:46:54 +0000
parents e4d9d77012bc
children 63eb95eea4ef
comparison
equal deleted inserted replaced
16351:ac552926fc7e 16352:dfe3713f8c75
1115 gc = XCreateGC (FRAME_X_DISPLAY (f), FRAME_X_WINDOW (f), 1115 gc = XCreateGC (FRAME_X_DISPLAY (f), FRAME_X_WINDOW (f),
1116 GCFunction | GCForeground, &values); 1116 GCFunction | GCForeground, &values);
1117 } 1117 }
1118 1118
1119 { 1119 {
1120 int width = PIXEL_WIDTH (f); 1120 /* Get the height not including a menu bar widget. */
1121 int height = PIXEL_HEIGHT (f); 1121 int height = CHAR_TO_PIXEL_HEIGHT (f, FRAME_HEIGHT (f));
1122 1122 /* Height of each line to flash. */
1123 XFillRectangle (FRAME_X_DISPLAY (f), FRAME_X_WINDOW (f), gc, 1123 int flash_height = FRAME_LINE_HEIGHT (f);
1124 width/4, height/4, width/2, height/2); 1124 /* These will be the left and right margins of the rectangles. */
1125 int flash_left = FRAME_INTERNAL_BORDER_WIDTH (f);
1126 int flash_right = PIXEL_WIDTH (f) - FRAME_INTERNAL_BORDER_WIDTH (f);
1127
1128 int width;
1129
1130 /* Don't flash the area between a scroll bar and the frame
1131 edge it is next to. */
1132 switch (FRAME_VERTICAL_SCROLL_BAR_TYPE (f))
1133 {
1134 case vertical_scroll_bar_left:
1135 flash_left += VERTICAL_SCROLL_BAR_WIDTH_TRIM;
1136 break;
1137
1138 case vertical_scroll_bar_right:
1139 flash_right -= VERTICAL_SCROLL_BAR_WIDTH_TRIM;
1140 break;
1141 }
1142
1143 width = flash_right - flash_left;
1144
1145 /* If window is tall, flash top and bottom line. */
1146 if (height > 3 * FRAME_LINE_HEIGHT (f))
1147 {
1148 XFillRectangle (FRAME_X_DISPLAY (f), FRAME_X_WINDOW (f), gc,
1149 flash_left, FRAME_INTERNAL_BORDER_WIDTH (f),
1150 width, flash_height);
1151 XFillRectangle (FRAME_X_DISPLAY (f), FRAME_X_WINDOW (f), gc,
1152 flash_left,
1153 (height - flash_height
1154 - FRAME_INTERNAL_BORDER_WIDTH (f)),
1155 width, flash_height);
1156 }
1157 else
1158 /* If it is short, flash it all. */
1159 XFillRectangle (FRAME_X_DISPLAY (f), FRAME_X_WINDOW (f), gc,
1160 flash_left, FRAME_INTERNAL_BORDER_WIDTH (f),
1161 width, height - 2 * FRAME_INTERNAL_BORDER_WIDTH (f));
1162
1125 XFlush (FRAME_X_DISPLAY (f)); 1163 XFlush (FRAME_X_DISPLAY (f));
1126 1164
1127 { 1165 {
1128 struct timeval wakeup, now; 1166 struct timeval wakeup, now;
1129 1167
1149 /* Try to wait that long--but we might wake up sooner. */ 1187 /* Try to wait that long--but we might wake up sooner. */
1150 select (0, NULL, NULL, NULL, &timeout); 1188 select (0, NULL, NULL, NULL, &timeout);
1151 } 1189 }
1152 } 1190 }
1153 1191
1154 XFillRectangle (FRAME_X_DISPLAY (f), FRAME_X_WINDOW (f), gc, 1192 /* If window is tall, flash top and bottom line. */
1155 width/4, height/4, width/2, height/2); 1193 if (height > 3 * FRAME_LINE_HEIGHT (f))
1194 {
1195 XFillRectangle (FRAME_X_DISPLAY (f), FRAME_X_WINDOW (f), gc,
1196 flash_left, FRAME_INTERNAL_BORDER_WIDTH (f),
1197 width, flash_height);
1198 XFillRectangle (FRAME_X_DISPLAY (f), FRAME_X_WINDOW (f), gc,
1199 flash_left,
1200 (height - flash_height
1201 - FRAME_INTERNAL_BORDER_WIDTH (f)),
1202 width, flash_height);
1203 }
1204 else
1205 /* If it is short, flash it all. */
1206 XFillRectangle (FRAME_X_DISPLAY (f), FRAME_X_WINDOW (f), gc,
1207 flash_left, FRAME_INTERNAL_BORDER_WIDTH (f),
1208 width, height - 2 * FRAME_INTERNAL_BORDER_WIDTH (f));
1209
1156 XFreeGC (FRAME_X_DISPLAY (f), gc); 1210 XFreeGC (FRAME_X_DISPLAY (f), gc);
1157 XFlush (FRAME_X_DISPLAY (f)); 1211 XFlush (FRAME_X_DISPLAY (f));
1158 } 1212 }
1159 } 1213 }
1160 1214
3239 int 3293 int
3240 XTread_socket (sd, bufp, numchars, expected) 3294 XTread_socket (sd, bufp, numchars, expected)
3241 register int sd; 3295 register int sd;
3242 /* register */ struct input_event *bufp; 3296 /* register */ struct input_event *bufp;
3243 /* register */ int numchars; 3297 /* register */ int numchars;
3244 int waitp;
3245 int expected; 3298 int expected;
3246 { 3299 {
3247 int count = 0; 3300 int count = 0;
3248 int nbytes = 0; 3301 int nbytes = 0;
3249 int mask; 3302 int mask;