aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorPo Lu2021-12-18 03:40:44 +0000
committerPo Lu2021-12-18 03:40:44 +0000
commitf7755b88186bc70a35e0d8be422c8dd2f10db0ac (patch)
tree0d483c5531adad0dc1fc67e270ee4658662f484e /src
parent26d1f04d76333571b4dbe6d2cab75b44023574ee (diff)
downloademacs-f7755b88186bc70a35e0d8be422c8dd2f10db0ac.tar.gz
emacs-f7755b88186bc70a35e0d8be422c8dd2f10db0ac.zip
Flip buffers if display were modified in haiku_read_socket
* src/haikuterm.c (flush_dirty_back_buffers): New function. (haiku_read_socket): Flip buffers if the display could have been modified.
Diffstat (limited to 'src')
-rw-r--r--src/haikuterm.c32
1 files changed, 29 insertions, 3 deletions
diff --git a/src/haikuterm.c b/src/haikuterm.c
index f95a013867f..24fa44b01d0 100644
--- a/src/haikuterm.c
+++ b/src/haikuterm.c
@@ -2571,6 +2571,25 @@ haiku_make_fullscreen_consistent (struct frame *f)
2571 store_frame_param (f, Qfullscreen, lval); 2571 store_frame_param (f, Qfullscreen, lval);
2572} 2572}
2573 2573
2574static void
2575flush_dirty_back_buffers (void)
2576{
2577 block_input ();
2578 Lisp_Object tail, frame;
2579 FOR_EACH_FRAME (tail, frame)
2580 {
2581 struct frame *f = XFRAME (frame);
2582 if (FRAME_LIVE_P (f) &&
2583 FRAME_HAIKU_P (f) &&
2584 FRAME_HAIKU_WINDOW (f) &&
2585 !FRAME_GARBAGED_P (f) &&
2586 !buffer_flipping_blocked_p () &&
2587 FRAME_DIRTY_P (f))
2588 haiku_flip_buffers (f);
2589 }
2590 unblock_input ();
2591}
2592
2574static int 2593static int
2575haiku_read_socket (struct terminal *terminal, struct input_event *hold_quit) 2594haiku_read_socket (struct terminal *terminal, struct input_event *hold_quit)
2576{ 2595{
@@ -2580,6 +2599,7 @@ haiku_read_socket (struct terminal *terminal, struct input_event *hold_quit)
2580 ssize_t b_size; 2599 ssize_t b_size;
2581 struct unhandled_event *unhandled_events = NULL; 2600 struct unhandled_event *unhandled_events = NULL;
2582 int button_or_motion_p; 2601 int button_or_motion_p;
2602 int need_flush = 0;
2583 2603
2584 if (!buf) 2604 if (!buf)
2585 buf = xmalloc (200); 2605 buf = xmalloc (200);
@@ -2827,8 +2847,11 @@ haiku_read_socket (struct terminal *terminal, struct input_event *hold_quit)
2827 tab_bar_p = EQ (window, f->tab_bar_window); 2847 tab_bar_p = EQ (window, f->tab_bar_window);
2828 2848
2829 if (tab_bar_p) 2849 if (tab_bar_p)
2830 tab_bar_arg = handle_tab_bar_click 2850 {
2831 (f, x, y, type == BUTTON_DOWN, inev.modifiers); 2851 tab_bar_arg = handle_tab_bar_click
2852 (f, x, y, type == BUTTON_DOWN, inev.modifiers);
2853 need_flush = 1;
2854 }
2832 } 2855 }
2833 2856
2834 if (WINDOWP (f->tool_bar_window) 2857 if (WINDOWP (f->tool_bar_window)
@@ -2845,7 +2868,7 @@ haiku_read_socket (struct terminal *terminal, struct input_event *hold_quit)
2845 { 2868 {
2846 handle_tool_bar_click 2869 handle_tool_bar_click
2847 (f, x, y, type == BUTTON_DOWN, inev.modifiers); 2870 (f, x, y, type == BUTTON_DOWN, inev.modifiers);
2848 redisplay (); 2871 need_flush = 1;
2849 } 2872 }
2850 } 2873 }
2851 2874
@@ -3223,6 +3246,9 @@ haiku_read_socket (struct terminal *terminal, struct input_event *hold_quit)
3223 xfree (old); 3246 xfree (old);
3224 } 3247 }
3225 3248
3249 if (need_flush)
3250 flush_dirty_back_buffers ();
3251
3226 unblock_input (); 3252 unblock_input ();
3227 return message_count; 3253 return message_count;
3228} 3254}