diff options
| author | Richard M. Stallman | 1994-04-17 19:30:06 +0000 |
|---|---|---|
| committer | Richard M. Stallman | 1994-04-17 19:30:06 +0000 |
| commit | dc05a16bad76f364242cbb4c3452d8d556a7288f (patch) | |
| tree | 9a70a35102805ddbf0bc7560c0417327354c2c80 /src | |
| parent | 379564d6f84811434f4f1850696bc37058ae0c7e (diff) | |
| download | emacs-dc05a16bad76f364242cbb4c3452d8d556a7288f.tar.gz emacs-dc05a16bad76f364242cbb4c3452d8d556a7288f.zip | |
(dumpglyphs): When HL=2, check explicitly for using
the frame's default font or not.
(XTread_socket): For UnmapNotify, use x_any_window_to_frame.
(x_set_offset): New arg CHANGE_GRAVITY.
(x_make_frame_visible): Pass new arg.
(x_wm_set_size_hint): Args spec_x and spec_y deleted.
(x_set_offset, x_set_window_size): Don't pass those args.
(x_destroy_window): Just clear out mouse_face... vars.
(x_wm_set_size_hint): Use win_gravity from frame.
(x_make_frame_visible): Call x_set_offset.
Diffstat (limited to 'src')
| -rw-r--r-- | src/xterm.c | 52 |
1 files changed, 20 insertions, 32 deletions
diff --git a/src/xterm.c b/src/xterm.c index b8dce7fe041..2f385266f43 100644 --- a/src/xterm.c +++ b/src/xterm.c | |||
| @@ -610,7 +610,6 @@ dumpglyphs (f, left, top, gp, n, hl, just_foreground) | |||
| 610 | struct face *face = FRAME_DEFAULT_FACE (f); | 610 | struct face *face = FRAME_DEFAULT_FACE (f); |
| 611 | FONT_TYPE *font = FACE_FONT (face); | 611 | FONT_TYPE *font = FACE_FONT (face); |
| 612 | GC gc = FACE_GC (face); | 612 | GC gc = FACE_GC (face); |
| 613 | int defaulted = 1; | ||
| 614 | int gc_temporary = 0; | 613 | int gc_temporary = 0; |
| 615 | 614 | ||
| 616 | /* HL = 3 means use a mouse face previously chosen. */ | 615 | /* HL = 3 means use a mouse face previously chosen. */ |
| @@ -632,7 +631,6 @@ dumpglyphs (f, left, top, gp, n, hl, just_foreground) | |||
| 632 | face = intern_face (f, FRAME_COMPUTED_FACES (f) [cf]); | 631 | face = intern_face (f, FRAME_COMPUTED_FACES (f) [cf]); |
| 633 | font = FACE_FONT (face); | 632 | font = FACE_FONT (face); |
| 634 | gc = FACE_GC (face); | 633 | gc = FACE_GC (face); |
| 635 | defaulted = 0; | ||
| 636 | } | 634 | } |
| 637 | 635 | ||
| 638 | /* Then comes the distinction between modeline and normal text. */ | 636 | /* Then comes the distinction between modeline and normal text. */ |
| @@ -643,7 +641,6 @@ dumpglyphs (f, left, top, gp, n, hl, just_foreground) | |||
| 643 | face = FRAME_MODE_LINE_FACE (f); | 641 | face = FRAME_MODE_LINE_FACE (f); |
| 644 | font = FACE_FONT (face); | 642 | font = FACE_FONT (face); |
| 645 | gc = FACE_GC (face); | 643 | gc = FACE_GC (face); |
| 646 | defaulted = 0; | ||
| 647 | } | 644 | } |
| 648 | 645 | ||
| 649 | #define FACE_DEFAULT (~0) | 646 | #define FACE_DEFAULT (~0) |
| @@ -651,8 +648,7 @@ dumpglyphs (f, left, top, gp, n, hl, just_foreground) | |||
| 651 | /* Now override that if the cursor's on this character. */ | 648 | /* Now override that if the cursor's on this character. */ |
| 652 | if (hl == 2) | 649 | if (hl == 2) |
| 653 | { | 650 | { |
| 654 | if (defaulted | 651 | if (!face->font |
| 655 | || !face->font | ||
| 656 | || (int) face->font == FACE_DEFAULT) | 652 | || (int) face->font == FACE_DEFAULT) |
| 657 | { | 653 | { |
| 658 | gc = f->display.x->cursor_gc; | 654 | gc = f->display.x->cursor_gc; |
| @@ -3672,7 +3668,7 @@ XTread_socket (sd, bufp, numchars, waitp, expected) | |||
| 3672 | 3668 | ||
| 3673 | #ifdef HAVE_X11 | 3669 | #ifdef HAVE_X11 |
| 3674 | case UnmapNotify: | 3670 | case UnmapNotify: |
| 3675 | f = x_window_to_frame (event.xunmap.window); | 3671 | f = x_any_window_to_frame (event.xunmap.window); |
| 3676 | if (f) /* F may no longer exist if | 3672 | if (f) /* F may no longer exist if |
| 3677 | the frame was deleted. */ | 3673 | the frame was deleted. */ |
| 3678 | { | 3674 | { |
| @@ -5195,9 +5191,10 @@ x_calc_absolute_position (f) | |||
| 5195 | #endif /* ! defined (HAVE_X11) */ | 5191 | #endif /* ! defined (HAVE_X11) */ |
| 5196 | } | 5192 | } |
| 5197 | 5193 | ||
| 5198 | x_set_offset (f, xoff, yoff) | 5194 | x_set_offset (f, xoff, yoff, change_gravity) |
| 5199 | struct frame *f; | 5195 | struct frame *f; |
| 5200 | register int xoff, yoff; | 5196 | register int xoff, yoff; |
| 5197 | int change_gravity; | ||
| 5201 | { | 5198 | { |
| 5202 | f->display.x->top_pos = yoff; | 5199 | f->display.x->top_pos = yoff; |
| 5203 | f->display.x->left_pos = xoff; | 5200 | f->display.x->left_pos = xoff; |
| @@ -5212,7 +5209,10 @@ x_set_offset (f, xoff, yoff) | |||
| 5212 | f->display.x->left_pos, f->display.x->top_pos); | 5209 | f->display.x->left_pos, f->display.x->top_pos); |
| 5213 | #endif /* not USE_X_TOOLKIT */ | 5210 | #endif /* not USE_X_TOOLKIT */ |
| 5214 | #ifdef HAVE_X11 | 5211 | #ifdef HAVE_X11 |
| 5215 | x_wm_set_size_hint (f, 0, 1, xoff, yoff); | 5212 | if (change_gravity) |
| 5213 | f->display.x->win_gravity = NorthWestGravity; | ||
| 5214 | |||
| 5215 | x_wm_set_size_hint (f, 0, 1); | ||
| 5216 | #endif /* ! defined (HAVE_X11) */ | 5216 | #endif /* ! defined (HAVE_X11) */ |
| 5217 | UNBLOCK_INPUT; | 5217 | UNBLOCK_INPUT; |
| 5218 | } | 5218 | } |
| @@ -5248,7 +5248,7 @@ x_set_window_size (f, change_gravity, cols, rows) | |||
| 5248 | pixelheight = CHAR_TO_PIXEL_HEIGHT (f, rows); | 5248 | pixelheight = CHAR_TO_PIXEL_HEIGHT (f, rows); |
| 5249 | 5249 | ||
| 5250 | #ifdef HAVE_X11 | 5250 | #ifdef HAVE_X11 |
| 5251 | x_wm_set_size_hint (f, 0, change_gravity, 0, 0); | 5251 | x_wm_set_size_hint (f, 0, change_gravity); |
| 5252 | #endif /* ! defined (HAVE_X11) */ | 5252 | #endif /* ! defined (HAVE_X11) */ |
| 5253 | XSync (x_current_display, False); | 5253 | XSync (x_current_display, False); |
| 5254 | XChangeWindowSize (FRAME_X_WINDOW (f), pixelwidth, pixelheight); | 5254 | XChangeWindowSize (FRAME_X_WINDOW (f), pixelwidth, pixelheight); |
| @@ -5406,6 +5406,8 @@ x_make_frame_visible (f) | |||
| 5406 | if (! FRAME_VISIBLE_P (f)) | 5406 | if (! FRAME_VISIBLE_P (f)) |
| 5407 | { | 5407 | { |
| 5408 | #ifdef HAVE_X11 | 5408 | #ifdef HAVE_X11 |
| 5409 | x_set_offset (f, f->display.x->top_pos, f->display.x->left_pos, 0); | ||
| 5410 | |||
| 5409 | if (! EQ (Vx_no_window_manager, Qt)) | 5411 | if (! EQ (Vx_no_window_manager, Qt)) |
| 5410 | x_wm_set_window_state (f, NormalState); | 5412 | x_wm_set_window_state (f, NormalState); |
| 5411 | #ifdef USE_X_TOOLKIT | 5413 | #ifdef USE_X_TOOLKIT |
| @@ -5632,7 +5634,11 @@ x_destroy_window (f) | |||
| 5632 | x_highlight_frame = 0; | 5634 | x_highlight_frame = 0; |
| 5633 | 5635 | ||
| 5634 | if (f == mouse_face_mouse_frame) | 5636 | if (f == mouse_face_mouse_frame) |
| 5635 | clear_mouse_face (); | 5637 | { |
| 5638 | mouse_face_beg = -1; | ||
| 5639 | mouse_face_end = -1; | ||
| 5640 | mouse_face_window = Qnil; | ||
| 5641 | } | ||
| 5636 | 5642 | ||
| 5637 | UNBLOCK_INPUT; | 5643 | UNBLOCK_INPUT; |
| 5638 | } | 5644 | } |
| @@ -5717,16 +5723,12 @@ mouse_event_pending_p () | |||
| 5717 | 5723 | ||
| 5718 | /* SPEC_X and SPEC_Y are the specified positions. | 5724 | /* SPEC_X and SPEC_Y are the specified positions. |
| 5719 | We look only at their sign, to decide the gravity. | 5725 | We look only at their sign, to decide the gravity. |
| 5720 | If CHANGE_GRAVITY is 0, we ignore SPEC_X and SPEC_Y | 5726 | If CHANGE_GRAVITY is 0, we may set PWinGravity. */ |
| 5721 | and leave the gravity unchanged. | ||
| 5722 | |||
| 5723 | CHANGE_GRAVITY is nonzero when PROMPTING is nonzero. */ | ||
| 5724 | 5727 | ||
| 5725 | x_wm_set_size_hint (f, prompting, change_gravity, spec_x, spec_y) | 5728 | x_wm_set_size_hint (f, prompting, change_gravity) |
| 5726 | struct frame *f; | 5729 | struct frame *f; |
| 5727 | long prompting; | 5730 | long prompting; |
| 5728 | int change_gravity; | 5731 | int change_gravity; |
| 5729 | int spec_x, spec_y; | ||
| 5730 | { | 5732 | { |
| 5731 | XSizeHints size_hints; | 5733 | XSizeHints size_hints; |
| 5732 | 5734 | ||
| @@ -5805,27 +5807,13 @@ x_wm_set_size_hint (f, prompting, change_gravity, spec_x, spec_y) | |||
| 5805 | size_hints.flags |= USPosition; | 5807 | size_hints.flags |= USPosition; |
| 5806 | if (hints.flags & USSize) | 5808 | if (hints.flags & USSize) |
| 5807 | size_hints.flags |= USSize; | 5809 | size_hints.flags |= USSize; |
| 5808 | size_hints.win_gravity = hints.win_gravity; | ||
| 5809 | } | 5810 | } |
| 5810 | 5811 | ||
| 5812 | size_hints.win_gravity = f->display.x->win_gravity; | ||
| 5813 | |||
| 5811 | #if defined (PWinGravity) | 5814 | #if defined (PWinGravity) |
| 5812 | if (change_gravity) | 5815 | if (change_gravity) |
| 5813 | { | 5816 | { |
| 5814 | switch (((spec_x < 0) << 1) + (spec_y < 0)) | ||
| 5815 | { | ||
| 5816 | case 0: | ||
| 5817 | size_hints.win_gravity = NorthWestGravity; | ||
| 5818 | break; | ||
| 5819 | case 1: | ||
| 5820 | size_hints.win_gravity = SouthWestGravity; | ||
| 5821 | break; | ||
| 5822 | case 2: | ||
| 5823 | size_hints.win_gravity = NorthEastGravity; | ||
| 5824 | break; | ||
| 5825 | case 3: | ||
| 5826 | size_hints.win_gravity = SouthEastGravity; | ||
| 5827 | break; | ||
| 5828 | } | ||
| 5829 | if (! (size_hints.flags & USPosition)) | 5817 | if (! (size_hints.flags & USPosition)) |
| 5830 | size_hints.flags |= PWinGravity; | 5818 | size_hints.flags |= PWinGravity; |
| 5831 | } | 5819 | } |