aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorRichard M. Stallman1994-04-14 17:31:06 +0000
committerRichard M. Stallman1994-04-14 17:31:06 +0000
commit0134a21068d45f42c3f4af8baa48fd8f4471b96a (patch)
treeaacdf6f5a295a35cba861dbd1cf998940b7113c0 /src
parent90eb101970bd8052cd5465c161858fcd4429c052 (diff)
downloademacs-0134a21068d45f42c3f4af8baa48fd8f4471b96a.tar.gz
emacs-0134a21068d45f42c3f4af8baa48fd8f4471b96a.zip
(x_make_frame_visible): Don't call XMapSubwindows.
(x_iconify_frame): Likewise. (pending_autoraise_frame): New variable. (x_new_focus_frame): Don't autoraise here; just set that var. (XTread_socket): Raise that frame here. (x_destroy_window): Call clear_mouse_face if necessary. (x_new_font): Always call x_set_window_size. (x_wm_set_size_hint): If PROMPTING is 0, copy the old win_gravity field. If USPosition is set, don't set PWinGravity. (x_wm_set_size_hint): If change_gravity is 0, just don't set the gravity.
Diffstat (limited to 'src')
-rw-r--r--src/xterm.c91
1 files changed, 54 insertions, 37 deletions
diff --git a/src/xterm.c b/src/xterm.c
index 54880dc843e..b8dce7fe041 100644
--- a/src/xterm.c
+++ b/src/xterm.c
@@ -193,6 +193,9 @@ extern struct frame *updating_frame;
193 x_focus_event_frame. */ 193 x_focus_event_frame. */
194struct frame *x_focus_frame; 194struct frame *x_focus_frame;
195 195
196/* This is a frame waiting to be autoraised, within XTread_socket. */
197struct frame *pending_autoraise_frame;
198
196/* The last frame mentioned in a FocusIn or FocusOut event. This is 199/* The last frame mentioned in a FocusIn or FocusOut event. This is
197 separate from x_focus_frame, because whether or not LeaveNotify 200 separate from x_focus_frame, because whether or not LeaveNotify
198 events cause us to lose focus depends on whether or not we have 201 events cause us to lose focus depends on whether or not we have
@@ -1717,7 +1720,9 @@ x_new_focus_frame (frame)
1717#endif /* ! 0 */ 1720#endif /* ! 0 */
1718 1721
1719 if (x_focus_frame && x_focus_frame->auto_raise) 1722 if (x_focus_frame && x_focus_frame->auto_raise)
1720 x_raise_frame (x_focus_frame); 1723 pending_autoraise_frame = x_focus_frame;
1724 else
1725 pending_autoraise_frame = 0;
1721 } 1726 }
1722 1727
1723 XTframe_rehighlight (); 1728 XTframe_rehighlight ();
@@ -4302,6 +4307,16 @@ XTread_socket (sd, bufp, numchars, waitp, expected)
4302 x_do_pending_expose (); 4307 x_do_pending_expose ();
4303#endif 4308#endif
4304 4309
4310 /* If the focus was just given to an autoraising frame,
4311 raise it now. */
4312#ifdef HAVE_X11
4313 if (pending_autoraise_frame)
4314 {
4315 x_raise_frame (pending_autoraise_frame);
4316 pending_autoraise_frame = 0;
4317 }
4318#endif
4319
4305 UNBLOCK_INPUT; 4320 UNBLOCK_INPUT;
4306 return count; 4321 return count;
4307} 4322}
@@ -5082,6 +5097,7 @@ x_new_font (f, fontname)
5082 f->display.x->font->fid); 5097 f->display.x->font->fid);
5083 5098
5084 frame_update_line_height (f); 5099 frame_update_line_height (f);
5100 x_set_window_size (f, 0, f->width, f->height);
5085 } 5101 }
5086 else 5102 else
5087 /* If we are setting a new frame's font for the first time, 5103 /* If we are setting a new frame's font for the first time,
@@ -5397,8 +5413,12 @@ x_make_frame_visible (f)
5397#else /* not USE_X_TOOLKIT */ 5413#else /* not USE_X_TOOLKIT */
5398 XMapWindow (XDISPLAY FRAME_X_WINDOW (f)); 5414 XMapWindow (XDISPLAY FRAME_X_WINDOW (f));
5399#endif /* not USE_X_TOOLKIT */ 5415#endif /* not USE_X_TOOLKIT */
5416#if 0 /* This seems to bring back scroll bars in the wrong places
5417 if the window configuration has changed. They seem
5418 to come back ok without this. */
5400 if (FRAME_HAS_VERTICAL_SCROLL_BARS (f)) 5419 if (FRAME_HAS_VERTICAL_SCROLL_BARS (f))
5401 XMapSubwindows (x_current_display, FRAME_X_WINDOW (f)); 5420 XMapSubwindows (x_current_display, FRAME_X_WINDOW (f));
5421#endif
5402#else /* ! defined (HAVE_X11) */ 5422#else /* ! defined (HAVE_X11) */
5403 XMapWindow (XDISPLAY FRAME_X_WINDOW (f)); 5423 XMapWindow (XDISPLAY FRAME_X_WINDOW (f));
5404 if (f->display.x->icon_desc != 0) 5424 if (f->display.x->icon_desc != 0)
@@ -5563,8 +5583,10 @@ x_iconify_frame (f)
5563 { 5583 {
5564 /* If the frame was withdrawn, before, we must map it. */ 5584 /* If the frame was withdrawn, before, we must map it. */
5565 XMapWindow (XDISPLAY FRAME_X_WINDOW (f)); 5585 XMapWindow (XDISPLAY FRAME_X_WINDOW (f));
5586#if 0 /* We don't have subwindows in the icon. */
5566 if (FRAME_HAS_VERTICAL_SCROLL_BARS (f)) 5587 if (FRAME_HAS_VERTICAL_SCROLL_BARS (f))
5567 XMapSubwindows (x_current_display, FRAME_X_WINDOW (f)); 5588 XMapSubwindows (x_current_display, FRAME_X_WINDOW (f));
5589#endif
5568 } 5590 }
5569 5591
5570 f->async_iconified = 1; 5592 f->async_iconified = 1;
@@ -5609,6 +5631,9 @@ x_destroy_window (f)
5609 if (f == x_highlight_frame) 5631 if (f == x_highlight_frame)
5610 x_highlight_frame = 0; 5632 x_highlight_frame = 0;
5611 5633
5634 if (f == mouse_face_mouse_frame)
5635 clear_mouse_face ();
5636
5612 UNBLOCK_INPUT; 5637 UNBLOCK_INPUT;
5613} 5638}
5614 5639
@@ -5690,13 +5715,12 @@ mouse_event_pending_p ()
5690 5715
5691#ifdef HAVE_X11 5716#ifdef HAVE_X11
5692 5717
5693/* Record the gravity used previously, in case CHANGE_GRAVITY is 0. */
5694static int previous_gravity;
5695
5696/* SPEC_X and SPEC_Y are the specified positions. 5718/* SPEC_X and SPEC_Y are the specified positions.
5697 We look only at their sign, to decide the gravity. 5719 We look only at their sign, to decide the gravity.
5698 If CHANGE_GRAVITY is 0, we ignore SPEC_X and SPEC_Y 5720 If CHANGE_GRAVITY is 0, we ignore SPEC_X and SPEC_Y
5699 and leave the gravity unchanged. */ 5721 and leave the gravity unchanged.
5722
5723 CHANGE_GRAVITY is nonzero when PROMPTING is nonzero. */
5700 5724
5701x_wm_set_size_hint (f, prompting, change_gravity, spec_x, spec_y) 5725x_wm_set_size_hint (f, prompting, change_gravity, spec_x, spec_y)
5702 struct frame *f; 5726 struct frame *f;
@@ -5733,42 +5757,36 @@ x_wm_set_size_hint (f, prompting, change_gravity, spec_x, spec_y)
5733#endif /* not USE_X_TOOLKIT */ 5757#endif /* not USE_X_TOOLKIT */
5734 size_hints.width_inc = FONT_WIDTH (f->display.x->font); 5758 size_hints.width_inc = FONT_WIDTH (f->display.x->font);
5735 size_hints.height_inc = f->display.x->line_height; 5759 size_hints.height_inc = f->display.x->line_height;
5736#if 0 5760
5737 size_hints.max_width = x_screen_width - CHAR_TO_PIXEL_WIDTH (f, 0);
5738 size_hints.max_height = x_screen_height - CHAR_TO_PIXEL_HEIGHT (f, 0);
5739#endif
5740 { 5761 {
5741 int base_width, base_height; 5762 int base_width, base_height;
5763 int min_rows = 0, min_cols = 0;
5742 5764
5743 base_width = CHAR_TO_PIXEL_WIDTH (f, 0); 5765 base_width = CHAR_TO_PIXEL_WIDTH (f, 0);
5744 base_height = CHAR_TO_PIXEL_HEIGHT (f, 0); 5766 base_height = CHAR_TO_PIXEL_HEIGHT (f, 0);
5745 5767
5746 { 5768 check_frame_size (f, &min_rows, &min_cols);
5747 int min_rows = 0, min_cols = 0;
5748 check_frame_size (f, &min_rows, &min_cols);
5749 5769
5750 /* The window manager uses the base width hints to calculate the 5770 /* The window manager uses the base width hints to calculate the
5751 current number of rows and columns in the frame while 5771 current number of rows and columns in the frame while
5752 resizing; min_width and min_height aren't useful for this 5772 resizing; min_width and min_height aren't useful for this
5753 purpose, since they might not give the dimensions for a 5773 purpose, since they might not give the dimensions for a
5754 zero-row, zero-column frame. 5774 zero-row, zero-column frame.
5755 5775
5756 We use the base_width and base_height members if we have 5776 We use the base_width and base_height members if we have
5757 them; otherwise, we set the min_width and min_height members 5777 them; otherwise, we set the min_width and min_height members
5758 to the size for a zero x zero frame. */ 5778 to the size for a zero x zero frame. */
5759 5779
5760#ifdef HAVE_X11R4 5780#ifdef HAVE_X11R4
5761 size_hints.flags |= PBaseSize; 5781 size_hints.flags |= PBaseSize;
5762 size_hints.base_width = base_width; 5782 size_hints.base_width = base_width;
5763 size_hints.base_height = base_height; 5783 size_hints.base_height = base_height;
5764 size_hints.min_width = base_width + min_cols * size_hints.width_inc; 5784 size_hints.min_width = base_width + min_cols * size_hints.width_inc;
5765 size_hints.min_height = base_height + min_rows * size_hints.height_inc; 5785 size_hints.min_height = base_height + min_rows * size_hints.height_inc;
5766#else 5786#else
5767 size_hints.min_width = base_width; 5787 size_hints.min_width = base_width;
5768 size_hints.min_height = base_height; 5788 size_hints.min_height = base_height;
5769#endif 5789#endif
5770 }
5771
5772 } 5790 }
5773 5791
5774 if (prompting) 5792 if (prompting)
@@ -5787,7 +5805,9 @@ x_wm_set_size_hint (f, prompting, change_gravity, spec_x, spec_y)
5787 size_hints.flags |= USPosition; 5805 size_hints.flags |= USPosition;
5788 if (hints.flags & USSize) 5806 if (hints.flags & USSize)
5789 size_hints.flags |= USSize; 5807 size_hints.flags |= USSize;
5808 size_hints.win_gravity = hints.win_gravity;
5790 } 5809 }
5810
5791#if defined (PWinGravity) 5811#if defined (PWinGravity)
5792 if (change_gravity) 5812 if (change_gravity)
5793 { 5813 {
@@ -5797,21 +5817,18 @@ x_wm_set_size_hint (f, prompting, change_gravity, spec_x, spec_y)
5797 size_hints.win_gravity = NorthWestGravity; 5817 size_hints.win_gravity = NorthWestGravity;
5798 break; 5818 break;
5799 case 1: 5819 case 1:
5800 size_hints.win_gravity = NorthEastGravity; 5820 size_hints.win_gravity = SouthWestGravity;
5801 break; 5821 break;
5802 case 2: 5822 case 2:
5803 size_hints.win_gravity = SouthWestGravity; 5823 size_hints.win_gravity = NorthEastGravity;
5804 break; 5824 break;
5805 case 3: 5825 case 3:
5806 size_hints.win_gravity = SouthEastGravity; 5826 size_hints.win_gravity = SouthEastGravity;
5807 break; 5827 break;
5808 } 5828 }
5809 previous_gravity = size_hints.win_gravity; 5829 if (! (size_hints.flags & USPosition))
5830 size_hints.flags |= PWinGravity;
5810 } 5831 }
5811 else
5812 size_hints.win_gravity = previous_gravity;
5813
5814 size_hints.flags |= PWinGravity;
5815#endif /* PWinGravity */ 5832#endif /* PWinGravity */
5816 5833
5817#ifdef HAVE_X11R4 5834#ifdef HAVE_X11R4