summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRichard M. Stallman <rms@gnu.org>1998-08-05 01:42:24 +0000
committerRichard M. Stallman <rms@gnu.org>1998-08-05 01:42:24 +0000
commit2745e6c4cd6728e42a524d489a3ba87a67068523 (patch)
tree18b5a30831cf563619322fc8eb1845bb9c480af4
parent61d7e1dc5bf3b2686156f8b35609a8105f115f8f (diff)
downloademacs-2745e6c4cd6728e42a524d489a3ba87a67068523.tar.gz
emacs-2745e6c4cd6728e42a524d489a3ba87a67068523.tar.bz2
emacs-2745e6c4cd6728e42a524d489a3ba87a67068523.zip
(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.
-rw-r--r--src/xterm.c31
1 files changed, 22 insertions, 9 deletions
diff --git a/src/xterm.c b/src/xterm.c
index 1668a27089b..5ae37327d7f 100644
--- a/src/xterm.c
+++ b/src/xterm.c
@@ -2609,7 +2609,7 @@ fast_find_position (window, pos, columnp, rowp)
else if (charstarts[left + i] > pos)
break;
else if (charstarts[left + i] > 0)
- lastcol = left + i;
+ lastcol = left + i + 1;
}
/* If we're looking for the end of the buffer,
@@ -5834,7 +5834,7 @@ x_make_frame_visible (f)
/* This must come after we set COUNT. */
UNBLOCK_INPUT;
- /* Arriving X events are processed here. */
+ /* We unblock here so that arriving X events are processed. */
/* Now move the window back to where it was "supposed to be".
But don't do it if the gravity is negative.
@@ -5849,15 +5849,27 @@ x_make_frame_visible (f)
&& f->output_data.x->win_gravity == NorthWestGravity
&& previously_visible)
{
+ Drawable rootw;
+ int x, y;
+ unsigned int width, height, border, depth;
+
BLOCK_INPUT;
-#ifdef USE_X_TOOLKIT
- XMoveWindow (FRAME_X_DISPLAY (f), XtWindow (f->output_data.x->widget),
- original_left, original_top);
-#else /* not USE_X_TOOLKIT */
- XMoveWindow (FRAME_X_DISPLAY (f), FRAME_X_WINDOW (f),
- original_left, original_top);
-#endif /* not USE_X_TOOLKIT */
+ /* On some window managers (Such as FVWM) moving an existing window,
+ even to the same place, causes the window manager to introduce
+ an offset. This can cause the window to move to an unexpected
+ location. Check the geometry (A little slow here) and then verify
+ that the window is in the right place. If the window is not in
+ the right place, move it there, and take the potential window
+ manager hit. */
+
+ XGetGeometry (FRAME_X_DISPLAY (f), FRAME_OUTER_WINDOW (f),
+ &rootw, &x, &y, &width, &height, &border, &depth);
+
+ if (original_left != x || original_top != y)
+ XMoveWindow (FRAME_X_DISPLAY (f), FRAME_OUTER_WINDOW (f),
+ original_left, original_top);
+
UNBLOCK_INPUT;
}
@@ -6485,6 +6497,7 @@ x_list_fonts (f, pattern, size, maxnames)
}
else
try_XLoadQueryFont = 0;
+ XFreeFont (font);
}
if (!try_XLoadQueryFont)