diff options
| author | Richard M. Stallman | 1997-05-27 03:09:37 +0000 |
|---|---|---|
| committer | Richard M. Stallman | 1997-05-27 03:09:37 +0000 |
| commit | 1aa6072f7d8439d34950925c51c21e0cb1625279 (patch) | |
| tree | 9ba37ad060c4d0422410f1b8eb4c3ef12e025aad /src | |
| parent | 91a78190f123a8b80e1f8384cf1d0b46ebc06cfa (diff) | |
| download | emacs-1aa6072f7d8439d34950925c51c21e0cb1625279.tar.gz emacs-1aa6072f7d8439d34950925c51c21e0cb1625279.zip | |
(XTread_socket) <UnmapNotify>: Don't make an inconify_event
when frame was made invisible.
(x_make_frame_visible): Put the call to x_set_offset back as it was.
Near the end, instead call XMoveWindow, but only if original
positions were not negative.
Diffstat (limited to 'src')
| -rw-r--r-- | src/xterm.c | 59 |
1 files changed, 42 insertions, 17 deletions
diff --git a/src/xterm.c b/src/xterm.c index b191769135b..5c1451e1745 100644 --- a/src/xterm.c +++ b/src/xterm.c | |||
| @@ -4012,15 +4012,19 @@ XTread_socket (sd, bufp, numchars, expected) | |||
| 4012 | /* We can't distinguish, from the event, whether the window | 4012 | /* We can't distinguish, from the event, whether the window |
| 4013 | has become iconified or invisible. So assume, if it | 4013 | has become iconified or invisible. So assume, if it |
| 4014 | was previously visible, than now it is iconified. | 4014 | was previously visible, than now it is iconified. |
| 4015 | We depend on x_make_frame_invisible to mark it invisible. */ | 4015 | But x_make_frame_invisible clears both |
| 4016 | the visible flag and the iconified flag; | ||
| 4017 | and that way, we know the window is not iconified now. */ | ||
| 4016 | if (FRAME_VISIBLE_P (f) || FRAME_ICONIFIED_P (f)) | 4018 | if (FRAME_VISIBLE_P (f) || FRAME_ICONIFIED_P (f)) |
| 4017 | f->async_iconified = 1; | 4019 | { |
| 4020 | f->async_iconified = 1; | ||
| 4018 | 4021 | ||
| 4019 | bufp->kind = iconify_event; | 4022 | bufp->kind = iconify_event; |
| 4020 | XSETFRAME (bufp->frame_or_window, f); | 4023 | XSETFRAME (bufp->frame_or_window, f); |
| 4021 | bufp++; | 4024 | bufp++; |
| 4022 | count++; | 4025 | count++; |
| 4023 | numchars--; | 4026 | numchars--; |
| 4027 | } | ||
| 4024 | } | 4028 | } |
| 4025 | goto OTHER; | 4029 | goto OTHER; |
| 4026 | 4030 | ||
| @@ -5619,6 +5623,8 @@ x_make_frame_visible (f) | |||
| 5619 | { | 5623 | { |
| 5620 | int mask; | 5624 | int mask; |
| 5621 | Lisp_Object type; | 5625 | Lisp_Object type; |
| 5626 | int starting_flags = f->output_data.x->size_hint_flags; | ||
| 5627 | int original_top, original_left; | ||
| 5622 | 5628 | ||
| 5623 | BLOCK_INPUT; | 5629 | BLOCK_INPUT; |
| 5624 | 5630 | ||
| @@ -5628,6 +5634,16 @@ x_make_frame_visible (f) | |||
| 5628 | 5634 | ||
| 5629 | if (! FRAME_VISIBLE_P (f)) | 5635 | if (! FRAME_VISIBLE_P (f)) |
| 5630 | { | 5636 | { |
| 5637 | /* We test FRAME_GARBAGED_P here to make sure we don't | ||
| 5638 | call x_set_offset a second time | ||
| 5639 | if we get to x_make_frame_visible a second time | ||
| 5640 | before the window gets really visible. */ | ||
| 5641 | if (! FRAME_ICONIFIED_P (f) | ||
| 5642 | && ! f->output_data.x->asked_for_visible) | ||
| 5643 | x_set_offset (f, f->output_data.x->left_pos, f->output_data.x->top_pos, 0); | ||
| 5644 | |||
| 5645 | f->output_data.x->asked_for_visible = 1; | ||
| 5646 | |||
| 5631 | if (! EQ (Vx_no_window_manager, Qt)) | 5647 | if (! EQ (Vx_no_window_manager, Qt)) |
| 5632 | x_wm_set_window_state (f, NormalState); | 5648 | x_wm_set_window_state (f, NormalState); |
| 5633 | #ifdef USE_X_TOOLKIT | 5649 | #ifdef USE_X_TOOLKIT |
| @@ -5652,21 +5668,30 @@ x_make_frame_visible (f) | |||
| 5652 | { | 5668 | { |
| 5653 | Lisp_Object frame; | 5669 | Lisp_Object frame; |
| 5654 | int count = input_signal_count; | 5670 | int count = input_signal_count; |
| 5655 | int orig_left = f->output_data.x->left_pos; | 5671 | |
| 5656 | int orig_top = f->output_data.x->top_pos; | 5672 | original_left = f->output_data.x->left_pos; |
| 5673 | original_top = f->output_data.x->top_pos; | ||
| 5657 | 5674 | ||
| 5658 | /* This must come after we set COUNT. */ | 5675 | /* This must come after we set COUNT. */ |
| 5659 | UNBLOCK_INPUT; | 5676 | UNBLOCK_INPUT; |
| 5660 | 5677 | ||
| 5661 | /* We test asked_for_visible here to make sure we don't | 5678 | /* Arriving X events are processed here. */ |
| 5662 | call x_set_offset a second time | 5679 | |
| 5663 | if we get to x_make_frame_visible a second time | 5680 | /* Now move the window back to where it was "supposed to be". */ |
| 5664 | before the window gets really visible. */ | 5681 | |
| 5665 | if (! FRAME_ICONIFIED_P (f) | 5682 | if (! (starting_flags & (XNegative | YNegative))) |
| 5666 | && ! f->output_data.x->asked_for_visible) | 5683 | { |
| 5667 | x_set_offset (f, orig_left, orig_top, 0); | 5684 | BLOCK_INPUT; |
| 5668 | 5685 | ||
| 5669 | f->output_data.x->asked_for_visible = 1; | 5686 | #ifdef USE_X_TOOLKIT |
| 5687 | XMoveWindow (FRAME_X_DISPLAY (f), XtWindow (f->output_data.x->widget), | ||
| 5688 | original_left, original_top); | ||
| 5689 | #else /* not USE_X_TOOLKIT */ | ||
| 5690 | XMoveWindow (FRAME_X_DISPLAY (f), FRAME_X_WINDOW (f), | ||
| 5691 | original_left, original_top); | ||
| 5692 | #endif /* not USE_X_TOOLKIT */ | ||
| 5693 | UNBLOCK_INPUT; | ||
| 5694 | } | ||
| 5670 | 5695 | ||
| 5671 | XSETFRAME (frame, f); | 5696 | XSETFRAME (frame, f); |
| 5672 | 5697 | ||