comparison src/xterm.c @ 22907:43e290c6fb19

(x_list_fonts): Call XFreeFont after the new call to XLoadQueryFont. (fast_find_position): Handle case where position is before an invisible character, thus not actually listed in charstarts. (x_make_frame_visible): Use XGetGeometry to see if position has been changed by the window manager. Use FRAME_OUTER_WINDOW.
author Richard M. Stallman <rms@gnu.org>
date Wed, 05 Aug 1998 01:42:24 +0000
parents bd776f15bb43
children 5493321d4526
comparison
equal deleted inserted replaced
22906:adfc04c48002 22907:43e290c6fb19
2607 return 1; 2607 return 1;
2608 } 2608 }
2609 else if (charstarts[left + i] > pos) 2609 else if (charstarts[left + i] > pos)
2610 break; 2610 break;
2611 else if (charstarts[left + i] > 0) 2611 else if (charstarts[left + i] > 0)
2612 lastcol = left + i; 2612 lastcol = left + i + 1;
2613 } 2613 }
2614 2614
2615 /* If we're looking for the end of the buffer, 2615 /* If we're looking for the end of the buffer,
2616 and we didn't find it in the line we scanned, 2616 and we didn't find it in the line we scanned,
2617 use the start of the following line. */ 2617 use the start of the following line. */
5832 original_top = f->output_data.x->top_pos; 5832 original_top = f->output_data.x->top_pos;
5833 5833
5834 /* This must come after we set COUNT. */ 5834 /* This must come after we set COUNT. */
5835 UNBLOCK_INPUT; 5835 UNBLOCK_INPUT;
5836 5836
5837 /* Arriving X events are processed here. */ 5837 /* We unblock here so that arriving X events are processed. */
5838 5838
5839 /* Now move the window back to where it was "supposed to be". 5839 /* Now move the window back to where it was "supposed to be".
5840 But don't do it if the gravity is negative. 5840 But don't do it if the gravity is negative.
5841 When the gravity is negative, this uses a position 5841 When the gravity is negative, this uses a position
5842 that is 3 pixels too low. Perhaps that's really the border width. 5842 that is 3 pixels too low. Perhaps that's really the border width.
5847 5847
5848 if (! FRAME_VISIBLE_P (f) && ! FRAME_ICONIFIED_P (f) 5848 if (! FRAME_VISIBLE_P (f) && ! FRAME_ICONIFIED_P (f)
5849 && f->output_data.x->win_gravity == NorthWestGravity 5849 && f->output_data.x->win_gravity == NorthWestGravity
5850 && previously_visible) 5850 && previously_visible)
5851 { 5851 {
5852 Drawable rootw;
5853 int x, y;
5854 unsigned int width, height, border, depth;
5855
5852 BLOCK_INPUT; 5856 BLOCK_INPUT;
5853 5857
5854 #ifdef USE_X_TOOLKIT 5858 /* On some window managers (Such as FVWM) moving an existing window,
5855 XMoveWindow (FRAME_X_DISPLAY (f), XtWindow (f->output_data.x->widget), 5859 even to the same place, causes the window manager to introduce
5856 original_left, original_top); 5860 an offset. This can cause the window to move to an unexpected
5857 #else /* not USE_X_TOOLKIT */ 5861 location. Check the geometry (A little slow here) and then verify
5858 XMoveWindow (FRAME_X_DISPLAY (f), FRAME_X_WINDOW (f), 5862 that the window is in the right place. If the window is not in
5859 original_left, original_top); 5863 the right place, move it there, and take the potential window
5860 #endif /* not USE_X_TOOLKIT */ 5864 manager hit. */
5865
5866 XGetGeometry (FRAME_X_DISPLAY (f), FRAME_OUTER_WINDOW (f),
5867 &rootw, &x, &y, &width, &height, &border, &depth);
5868
5869 if (original_left != x || original_top != y)
5870 XMoveWindow (FRAME_X_DISPLAY (f), FRAME_OUTER_WINDOW (f),
5871 original_left, original_top);
5872
5861 UNBLOCK_INPUT; 5873 UNBLOCK_INPUT;
5862 } 5874 }
5863 5875
5864 XSETFRAME (frame, f); 5876 XSETFRAME (frame, f);
5865 5877
6483 bcopy (name, names[0], len + 1); 6495 bcopy (name, names[0], len + 1);
6484 XFree (name); 6496 XFree (name);
6485 } 6497 }
6486 else 6498 else
6487 try_XLoadQueryFont = 0; 6499 try_XLoadQueryFont = 0;
6500 XFreeFont (font);
6488 } 6501 }
6489 6502
6490 if (!try_XLoadQueryFont) 6503 if (!try_XLoadQueryFont)
6491 names = XListFonts (dpy, XSTRING (pattern)->data, maxnames, 6504 names = XListFonts (dpy, XSTRING (pattern)->data, maxnames,
6492 &num_fonts); 6505 &num_fonts);