diff options
Diffstat (limited to 'src/xterm.c')
| -rw-r--r-- | src/xterm.c | 72 |
1 files changed, 42 insertions, 30 deletions
diff --git a/src/xterm.c b/src/xterm.c index 0ff7804112f..398669d39a4 100644 --- a/src/xterm.c +++ b/src/xterm.c | |||
| @@ -21456,45 +21456,49 @@ handle_one_xevent (struct x_display_info *dpyinfo, | |||
| 21456 | } | 21456 | } |
| 21457 | 21457 | ||
| 21458 | #if defined HAVE_GTK3 && defined USE_TOOLKIT_SCROLL_BARS | 21458 | #if defined HAVE_GTK3 && defined USE_TOOLKIT_SCROLL_BARS |
| 21459 | struct scroll_bar *bar = x_window_to_scroll_bar (dpyinfo->display, | 21459 | struct scroll_bar *bar = x_window_to_scroll_bar (dpyinfo->display, |
| 21460 | configureEvent.xconfigure.window, 2); | 21460 | configureEvent.xconfigure.window, 2); |
| 21461 | 21461 | ||
| 21462 | /* There is really no other way to make GTK scroll bars fit | 21462 | /* There is really no other way to make GTK scroll bars fit |
| 21463 | in the dimensions we want them to. */ | 21463 | in the dimensions we want them to. */ |
| 21464 | if (bar) | 21464 | if (bar) |
| 21465 | { | ||
| 21466 | /* Skip all the pending configure events, not just the | ||
| 21467 | ones where window motion occurred. */ | ||
| 21468 | while (XPending (dpyinfo->display)) | ||
| 21465 | { | 21469 | { |
| 21466 | /* Skip all the pending configure events, not just the | 21470 | XNextEvent (dpyinfo->display, &next_event); |
| 21467 | ones where window motion occurred. */ | 21471 | if (next_event.type != ConfigureNotify |
| 21468 | while (XPending (dpyinfo->display)) | 21472 | || next_event.xconfigure.window != event->xconfigure.window) |
| 21469 | { | 21473 | { |
| 21470 | XNextEvent (dpyinfo->display, &next_event); | 21474 | XPutBackEvent (dpyinfo->display, &next_event); |
| 21471 | if (next_event.type != ConfigureNotify | 21475 | break; |
| 21472 | || next_event.xconfigure.window != event->xconfigure.window) | ||
| 21473 | { | ||
| 21474 | XPutBackEvent (dpyinfo->display, &next_event); | ||
| 21475 | break; | ||
| 21476 | } | ||
| 21477 | else | ||
| 21478 | configureEvent = next_event; | ||
| 21479 | } | 21476 | } |
| 21477 | else | ||
| 21478 | configureEvent = next_event; | ||
| 21479 | } | ||
| 21480 | 21480 | ||
| 21481 | if (configureEvent.xconfigure.width != max (bar->width, 1) | 21481 | if (configureEvent.xconfigure.width != max (bar->width, 1) |
| 21482 | || configureEvent.xconfigure.height != max (bar->height, 1)) | 21482 | || configureEvent.xconfigure.height != max (bar->height, 1)) |
| 21483 | { | 21483 | { |
| 21484 | XResizeWindow (dpyinfo->display, bar->x_window, | 21484 | XResizeWindow (dpyinfo->display, bar->x_window, |
| 21485 | max (bar->width, 1), max (bar->height, 1)); | 21485 | max (bar->width, 1), max (bar->height, 1)); |
| 21486 | x_flush (WINDOW_XFRAME (XWINDOW (bar->window))); | 21486 | x_flush (WINDOW_XFRAME (XWINDOW (bar->window))); |
| 21487 | } | 21487 | } |
| 21488 | 21488 | ||
| 21489 | #ifdef HAVE_XDBE | 21489 | #ifdef HAVE_XDBE |
| 21490 | if (f && FRAME_X_DOUBLE_BUFFERED_P (f)) | 21490 | if (f && FRAME_X_DOUBLE_BUFFERED_P (f)) |
| 21491 | x_drop_xrender_surfaces (f); | 21491 | x_drop_xrender_surfaces (f); |
| 21492 | #endif | 21492 | #endif |
| 21493 | 21493 | ||
| 21494 | goto OTHER; | 21494 | goto OTHER; |
| 21495 | } | 21495 | } |
| 21496 | #endif | 21496 | #endif |
| 21497 | 21497 | ||
| 21498 | /* XXX: it is strictly only necessary to provide the edit window | ||
| 21499 | to many of the statements below which only modify or invalidate | ||
| 21500 | resources assigned there. Most conditionals that alternate | ||
| 21501 | between `f' and `any' could ideally be removed. */ | ||
| 21498 | f = x_top_window_to_frame (dpyinfo, configureEvent.xconfigure.window); | 21502 | f = x_top_window_to_frame (dpyinfo, configureEvent.xconfigure.window); |
| 21499 | 21503 | ||
| 21500 | /* This means we can no longer be certain of the root window | 21504 | /* This means we can no longer be certain of the root window |
| @@ -21508,8 +21512,16 @@ handle_one_xevent (struct x_display_info *dpyinfo, | |||
| 21508 | for size changes: that's not sufficient. We miss some | 21512 | for size changes: that's not sufficient. We miss some |
| 21509 | surface invalidations and flicker. */ | 21513 | surface invalidations and flicker. */ |
| 21510 | #ifdef HAVE_XDBE | 21514 | #ifdef HAVE_XDBE |
| 21511 | if (f && FRAME_X_DOUBLE_BUFFERED_P (f)) | 21515 | { |
| 21512 | x_drop_xrender_surfaces (f); | 21516 | #if defined USE_GTK || defined USE_X_TOOLKIT |
| 21517 | /* Only modifications to the edit window (on which pictures are | ||
| 21518 | created) must be accompanied by invalidations. (bug#77988) */ | ||
| 21519 | struct frame *f | ||
| 21520 | = x_window_to_frame (dpyinfo, configureEvent.xconfigure.window); | ||
| 21521 | #endif /* USE_GTK || USE_X_TOOLKIT */ | ||
| 21522 | if (f && FRAME_X_DOUBLE_BUFFERED_P (f)) | ||
| 21523 | x_drop_xrender_surfaces (f); | ||
| 21524 | } | ||
| 21513 | #endif | 21525 | #endif |
| 21514 | #if defined USE_CAIRO && !defined USE_GTK | 21526 | #if defined USE_CAIRO && !defined USE_GTK |
| 21515 | if (f) | 21527 | if (f) |