diff options
| author | Po Lu | 2022-05-03 09:22:06 +0800 |
|---|---|---|
| committer | Po Lu | 2022-05-03 09:22:06 +0800 |
| commit | 952cc28e58eafbdd409bf36f9ca656dae533542b (patch) | |
| tree | f51c18a73cff22d3b0b8294430b838cf59efbff6 /src/xterm.h | |
| parent | 64bcfcbd322d4fdb78c7d7dd0748dabc0e0b2cbc (diff) | |
| download | emacs-952cc28e58eafbdd409bf36f9ca656dae533542b.tar.gz emacs-952cc28e58eafbdd409bf36f9ca656dae533542b.zip | |
Clean up X11 double buffering code
This fixes several latent bugs where code went down the path
with double buffering enabled when it wasn't, and vice versa.
* src/xfns.c (x_set_inhibit_double_buffering): Improve
commentary and only define when HAVE_XDBE.
(x_mark_frame_dirty): Only set buffer flip flag when HAVE_XDBE.
(initial_set_up_x_back_buffer): Clean up coding style and remove
unnecessary block_input pair.
(Fx_double_buffered_p): Always return nil if !HAVE_XDBE.
(x_frame_parm_handlers): Don't set double buffering handler if
!HAVE_XDBE.
* src/xftfont.c (xftfont_drop_xrender_surfaces, xftfont_driver):
Only define when XDBE is available.
* src/xterm.c (x_drop_xrender_surfaces): Likewise.
(x_clear_window): Don't test double buffering flags when
!HAVE_XDBE.
(show_back_buffer): Only define when HAVE_XDBE.
(x_flip_and_flush): Don't try to flip when !HAVE_XDBE.
(XTframe_up_to_date): Likewise.
(XTbuffer_flipping_unblocked_hook): Only define when Xdbe is
available.
(x_clear_area): Don't test double buffering flags when Xdbe is
not available.
(flush_dirty_back_buffer_on): Don't define if there's no DBE.
(handle_one_xevent, x_create_terminal): Likewise.
* src/xterm.h (FRAME_X_DRAWABLE): Fix coding style.
Diffstat (limited to 'src/xterm.h')
| -rw-r--r-- | src/xterm.h | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/src/xterm.h b/src/xterm.h index 65349834c9b..80b57137981 100644 --- a/src/xterm.h +++ b/src/xterm.h | |||
| @@ -1025,13 +1025,15 @@ extern void x_mark_frame_dirty (struct frame *f); | |||
| 1025 | code after any drawing command, but we can run code whenever | 1025 | code after any drawing command, but we can run code whenever |
| 1026 | someone asks for the handle necessary to draw. */ | 1026 | someone asks for the handle necessary to draw. */ |
| 1027 | #define FRAME_X_DRAWABLE(f) \ | 1027 | #define FRAME_X_DRAWABLE(f) \ |
| 1028 | (x_mark_frame_dirty((f)), FRAME_X_RAW_DRAWABLE ((f))) | 1028 | (x_mark_frame_dirty ((f)), FRAME_X_RAW_DRAWABLE ((f))) |
| 1029 | 1029 | ||
| 1030 | #ifdef HAVE_XDBE | ||
| 1030 | #define FRAME_X_DOUBLE_BUFFERED_P(f) \ | 1031 | #define FRAME_X_DOUBLE_BUFFERED_P(f) \ |
| 1031 | (FRAME_X_WINDOW (f) != FRAME_X_RAW_DRAWABLE (f)) | 1032 | (FRAME_X_WINDOW (f) != FRAME_X_RAW_DRAWABLE (f)) |
| 1032 | 1033 | ||
| 1033 | /* Return the need-buffer-flip flag for frame F. */ | 1034 | /* Return the need-buffer-flip flag for frame F. */ |
| 1034 | #define FRAME_X_NEED_BUFFER_FLIP(f) ((f)->output_data.x->need_buffer_flip) | 1035 | #define FRAME_X_NEED_BUFFER_FLIP(f) ((f)->output_data.x->need_buffer_flip) |
| 1036 | #endif | ||
| 1035 | 1037 | ||
| 1036 | /* Return the outermost X window associated with the frame F. */ | 1038 | /* Return the outermost X window associated with the frame F. */ |
| 1037 | #ifdef USE_X_TOOLKIT | 1039 | #ifdef USE_X_TOOLKIT |