Mercurial > emacs
comparison src/xterm.c @ 1658:452ba03935d7
* xterm.c (XTread_socket): When we get MapNotify, UnmapNotify,
Expose, ExposeWindow, or UnmapWindow, set f->async_visible, not
f->visible.
(x_do_pending_expose, x_raise_frame, x_lower_frame,
x_make_frame_invisible, x_make_frame_visible, x_iconify_frame):
Test and set f->async_visible and f->async_iconified, not
f->visible or f->async_iconified.
author | Jim Blandy <jimb@redhat.com> |
---|---|
date | Sun, 06 Dec 1992 22:22:09 +0000 |
parents | a7f8a1fe258e |
children | 4f5e3ac5d822 |
comparison
equal
deleted
inserted
replaced
1657:14ff323eab0a | 1658:452ba03935d7 |
---|---|
1095 if (XTYPE (frame) != Lisp_Frame) | 1095 if (XTYPE (frame) != Lisp_Frame) |
1096 continue; | 1096 continue; |
1097 f = XFRAME (frame); | 1097 f = XFRAME (frame); |
1098 if (! FRAME_X_P (f)) | 1098 if (! FRAME_X_P (f)) |
1099 continue; | 1099 continue; |
1100 if (!f->visible) | 1100 if (!f->async_visible) |
1101 continue; | 1101 continue; |
1102 if (!f->display.x->needs_exposure) | 1102 if (!f->display.x->needs_exposure) |
1103 continue; | 1103 continue; |
1104 | 1104 |
1105 intborder = f->display.x->internal_border_width; | 1105 intborder = f->display.x->internal_border_width; |
1922 | 1922 |
1923 case Expose: | 1923 case Expose: |
1924 f = x_window_to_frame (event.xexpose.window); | 1924 f = x_window_to_frame (event.xexpose.window); |
1925 if (f) | 1925 if (f) |
1926 { | 1926 { |
1927 if (f->visible == 0) | 1927 if (f->async_visible == 0) |
1928 { | 1928 { |
1929 f->visible = 1; | 1929 f->async_visible = 1; |
1930 f->iconified = 0; | 1930 f->async_iconified = 0; |
1931 SET_FRAME_GARBAGED (f); | 1931 SET_FRAME_GARBAGED (f); |
1932 } | 1932 } |
1933 else | 1933 else |
1934 dumprectangle (x_window_to_frame (event.xexpose.window), | 1934 dumprectangle (x_window_to_frame (event.xexpose.window), |
1935 event.xexpose.x, event.xexpose.y, | 1935 event.xexpose.x, event.xexpose.y, |
1956 break; /* duplicate event */ | 1956 break; /* duplicate event */ |
1957 f = x_window_to_frame (event.window); | 1957 f = x_window_to_frame (event.window); |
1958 if (event.window == f->display.x->icon_desc) | 1958 if (event.window == f->display.x->icon_desc) |
1959 { | 1959 { |
1960 refreshicon (f); | 1960 refreshicon (f); |
1961 f->iconified = 1; | 1961 f->async_iconified = 1; |
1962 } | 1962 } |
1963 if (event.window == FRAME_X_WINDOW (f)) | 1963 if (event.window == FRAME_X_WINDOW (f)) |
1964 { | 1964 { |
1965 /* Say must check all windows' needs_exposure flags. */ | 1965 /* Say must check all windows' needs_exposure flags. */ |
1966 expose_all_windows = 1; | 1966 expose_all_windows = 1; |
1967 f->display.x->needs_exposure = 1; | 1967 f->display.x->needs_exposure = 1; |
1968 f->visible = 1; | 1968 f->async_visible = 1; |
1969 } | 1969 } |
1970 break; | 1970 break; |
1971 | 1971 |
1972 case ExposeRegion: | 1972 case ExposeRegion: |
1973 if (event.subwindow != 0) | 1973 if (event.subwindow != 0) |
2008 the frame was deleted. */ | 2008 the frame was deleted. */ |
2009 { | 2009 { |
2010 /* While a frame is unmapped, display generation is | 2010 /* While a frame is unmapped, display generation is |
2011 disabled; you don't want to spend time updating a | 2011 disabled; you don't want to spend time updating a |
2012 display that won't ever be seen. */ | 2012 display that won't ever be seen. */ |
2013 f->visible = 0; | 2013 f->async_visible = 0; |
2014 x_mouse_x = x_mouse_y = -1; | 2014 x_mouse_x = x_mouse_y = -1; |
2015 } | 2015 } |
2016 } | 2016 } |
2017 break; | 2017 break; |
2018 | 2018 |
2019 case MapNotify: | 2019 case MapNotify: |
2020 f = x_window_to_frame (event.xmap.window); | 2020 f = x_window_to_frame (event.xmap.window); |
2021 if (f) | 2021 if (f) |
2022 { | 2022 { |
2023 f->visible = 1; | 2023 f->async_visible = 1; |
2024 f->iconified = 0; | 2024 f->async_iconified = 0; |
2025 | 2025 |
2026 /* wait_reading_process_input will notice this and update | 2026 /* wait_reading_process_input will notice this and update |
2027 the frame's display structures. */ | 2027 the frame's display structures. */ |
2028 SET_FRAME_GARBAGED (f); | 2028 SET_FRAME_GARBAGED (f); |
2029 } | 2029 } |
2035 | 2035 |
2036 #else /* ! defined (HAVE_X11) */ | 2036 #else /* ! defined (HAVE_X11) */ |
2037 case UnmapWindow: | 2037 case UnmapWindow: |
2038 f = x_window_to_frame (event.window); | 2038 f = x_window_to_frame (event.window); |
2039 if (event.window == f->display.x->icon_desc) | 2039 if (event.window == f->display.x->icon_desc) |
2040 f->iconified = 0; | 2040 f->async_iconified = 0; |
2041 if (event.window == FRAME_X_WINDOW (f)) | 2041 if (event.window == FRAME_X_WINDOW (f)) |
2042 f->visible = 0; | 2042 f->async_visible = 0; |
2043 break; | 2043 break; |
2044 #endif /* ! defined (HAVE_X11) */ | 2044 #endif /* ! defined (HAVE_X11) */ |
2045 | 2045 |
2046 #ifdef HAVE_X11 | 2046 #ifdef HAVE_X11 |
2047 case KeyPress: | 2047 case KeyPress: |
3327 /* Raise frame F. */ | 3327 /* Raise frame F. */ |
3328 | 3328 |
3329 x_raise_frame (f) | 3329 x_raise_frame (f) |
3330 struct frame *f; | 3330 struct frame *f; |
3331 { | 3331 { |
3332 if (f->visible) | 3332 if (f->async_visible) |
3333 { | 3333 { |
3334 BLOCK_INPUT; | 3334 BLOCK_INPUT; |
3335 XRaiseWindow (XDISPLAY FRAME_X_WINDOW (f)); | 3335 XRaiseWindow (XDISPLAY FRAME_X_WINDOW (f)); |
3336 XFlushQueue (); | 3336 XFlushQueue (); |
3337 UNBLOCK_INPUT; | 3337 UNBLOCK_INPUT; |
3341 /* Lower frame F. */ | 3341 /* Lower frame F. */ |
3342 | 3342 |
3343 x_lower_frame (f) | 3343 x_lower_frame (f) |
3344 struct frame *f; | 3344 struct frame *f; |
3345 { | 3345 { |
3346 if (f->visible) | 3346 if (f->async_visible) |
3347 { | 3347 { |
3348 BLOCK_INPUT; | 3348 BLOCK_INPUT; |
3349 XLowerWindow (XDISPLAY FRAME_X_WINDOW (f)); | 3349 XLowerWindow (XDISPLAY FRAME_X_WINDOW (f)); |
3350 XFlushQueue (); | 3350 XFlushQueue (); |
3351 UNBLOCK_INPUT; | 3351 UNBLOCK_INPUT; |
3374 XMapWindow (XDISPLAY FRAME_X_WINDOW (f)); | 3374 XMapWindow (XDISPLAY FRAME_X_WINDOW (f)); |
3375 if (f->display.x->icon_desc != 0) | 3375 if (f->display.x->icon_desc != 0) |
3376 XUnmapWindow (f->display.x->icon_desc); | 3376 XUnmapWindow (f->display.x->icon_desc); |
3377 | 3377 |
3378 /* Handled by the MapNotify event for X11 */ | 3378 /* Handled by the MapNotify event for X11 */ |
3379 f->visible = 1; | 3379 f->async_visible = 1; |
3380 f->iconified = 0; | 3380 f->async_iconified = 0; |
3381 | 3381 |
3382 /* NOTE: this may cause problems for the first frame. */ | 3382 /* NOTE: this may cause problems for the first frame. */ |
3383 XTcursor_to (0, 0); | 3383 XTcursor_to (0, 0); |
3384 #endif /* ! defined (HAVE_X11) */ | 3384 #endif /* ! defined (HAVE_X11) */ |
3385 } | 3385 } |
3394 x_make_frame_invisible (f) | 3394 x_make_frame_invisible (f) |
3395 struct frame *f; | 3395 struct frame *f; |
3396 { | 3396 { |
3397 int mask; | 3397 int mask; |
3398 | 3398 |
3399 if (! f->visible) | 3399 if (! f->async_visible) |
3400 return; | 3400 return; |
3401 | 3401 |
3402 BLOCK_INPUT; | 3402 BLOCK_INPUT; |
3403 | 3403 |
3404 #ifdef HAVE_X11R4 | 3404 #ifdef HAVE_X11R4 |
3437 XUnmapWindow (x_current_display, FRAME_X_WINDOW (f)); | 3437 XUnmapWindow (x_current_display, FRAME_X_WINDOW (f)); |
3438 | 3438 |
3439 #else /* ! defined (HAVE_X11) */ | 3439 #else /* ! defined (HAVE_X11) */ |
3440 | 3440 |
3441 XUnmapWindow (FRAME_X_WINDOW (f)); | 3441 XUnmapWindow (FRAME_X_WINDOW (f)); |
3442 f->visible = 0; /* Handled by the UnMap event for X11 */ | 3442 f->async_visible = 0; /* Handled by the UnMap event for X11 */ |
3443 if (f->display.x->icon_desc != 0) | 3443 if (f->display.x->icon_desc != 0) |
3444 XUnmapWindow (f->display.x->icon_desc); | 3444 XUnmapWindow (f->display.x->icon_desc); |
3445 | 3445 |
3446 #endif /* ! defined (HAVE_X11) */ | 3446 #endif /* ! defined (HAVE_X11) */ |
3447 #endif /* ! defined (HAVE_X11R4) */ | 3447 #endif /* ! defined (HAVE_X11R4) */ |
3458 x_iconify_frame (f) | 3458 x_iconify_frame (f) |
3459 struct frame *f; | 3459 struct frame *f; |
3460 { | 3460 { |
3461 int mask; | 3461 int mask; |
3462 | 3462 |
3463 if (f->iconified) | 3463 if (f->async_iconified) |
3464 return; | 3464 return; |
3465 | 3465 |
3466 BLOCK_INPUT; | 3466 BLOCK_INPUT; |
3467 | 3467 |
3468 #ifdef HAVE_X11 | 3468 #ifdef HAVE_X11 |
3493 | 3493 |
3494 /* X11R3: set the initial_state field of the window manager hints to | 3494 /* X11R3: set the initial_state field of the window manager hints to |
3495 IconicState. */ | 3495 IconicState. */ |
3496 x_wm_set_window_state (f, IconicState); | 3496 x_wm_set_window_state (f, IconicState); |
3497 | 3497 |
3498 f->iconified = 1; | 3498 f->async_iconified = 1; |
3499 #else /* ! defined (HAVE_X11) */ | 3499 #else /* ! defined (HAVE_X11) */ |
3500 XUnmapWindow (XDISPLAY FRAME_X_WINDOW (f)); | 3500 XUnmapWindow (XDISPLAY FRAME_X_WINDOW (f)); |
3501 | 3501 |
3502 f->visible = 0; /* Handled in the UnMap event for X11. */ | 3502 f->async_visible = 0; /* Handled in the UnMap event for X11. */ |
3503 if (f->display.x->icon_desc != 0) | 3503 if (f->display.x->icon_desc != 0) |
3504 { | 3504 { |
3505 XMapWindow (XDISPLAY f->display.x->icon_desc); | 3505 XMapWindow (XDISPLAY f->display.x->icon_desc); |
3506 refreshicon (f); | 3506 refreshicon (f); |
3507 } | 3507 } |