diff options
| author | Po Lu | 2022-05-29 01:05:54 +0000 |
|---|---|---|
| committer | Po Lu | 2022-05-29 01:05:54 +0000 |
| commit | c92d73d271038c93a72c059ed0190bc09b95026d (patch) | |
| tree | ee54ccde0608c8408e53f33fd1d846d3ceae074b /src | |
| parent | 28d4952d423a088a53a82c8e02f283fa98b7e20d (diff) | |
| download | emacs-c92d73d271038c93a72c059ed0190bc09b95026d.tar.gz emacs-c92d73d271038c93a72c059ed0190bc09b95026d.zip | |
Fix pending window changes in haiku_set_window_size
* src/haikuterm.c (haiku_set_window_size): Wait for
FRAME_RESIZED events, then call `do_pending_window_change'.
(haiku_read_socket): Allow waiting for FRAME_RESIZED events.
Diffstat (limited to 'src')
| -rw-r--r-- | src/haikuterm.c | 15 |
1 files changed, 14 insertions, 1 deletions
diff --git a/src/haikuterm.c b/src/haikuterm.c index a4875562185..7f0bc1a8cf1 100644 --- a/src/haikuterm.c +++ b/src/haikuterm.c | |||
| @@ -2009,9 +2009,17 @@ haiku_set_window_size (struct frame *f, bool change_gravity, | |||
| 2009 | if (FRAME_HAIKU_WINDOW (f)) | 2009 | if (FRAME_HAIKU_WINDOW (f)) |
| 2010 | { | 2010 | { |
| 2011 | block_input (); | 2011 | block_input (); |
| 2012 | BWindow_resize (FRAME_HAIKU_WINDOW (f), width, height); | 2012 | BWindow_resize (FRAME_HAIKU_WINDOW (f), |
| 2013 | width, height); | ||
| 2014 | |||
| 2015 | if (FRAME_VISIBLE_P (f) | ||
| 2016 | && (width != FRAME_PIXEL_WIDTH (f) | ||
| 2017 | || height != FRAME_PIXEL_HEIGHT (f))) | ||
| 2018 | haiku_wait_for_event (f, FRAME_RESIZED); | ||
| 2013 | unblock_input (); | 2019 | unblock_input (); |
| 2014 | } | 2020 | } |
| 2021 | |||
| 2022 | do_pending_window_change (false); | ||
| 2015 | } | 2023 | } |
| 2016 | 2024 | ||
| 2017 | static void | 2025 | static void |
| @@ -3138,6 +3146,10 @@ haiku_read_socket (struct terminal *terminal, struct input_event *hold_quit) | |||
| 3138 | int width = lrint (b->px_widthf); | 3146 | int width = lrint (b->px_widthf); |
| 3139 | int height = lrint (b->px_heightf); | 3147 | int height = lrint (b->px_heightf); |
| 3140 | 3148 | ||
| 3149 | if (FRAME_OUTPUT_DATA (f)->wait_for_event_type | ||
| 3150 | == FRAME_RESIZED) | ||
| 3151 | FRAME_OUTPUT_DATA (f)->wait_for_event_type = -1; | ||
| 3152 | |||
| 3141 | if (FRAME_TOOLTIP_P (f)) | 3153 | if (FRAME_TOOLTIP_P (f)) |
| 3142 | { | 3154 | { |
| 3143 | if (FRAME_PIXEL_WIDTH (f) != width | 3155 | if (FRAME_PIXEL_WIDTH (f) != width |
| @@ -3166,6 +3178,7 @@ haiku_read_socket (struct terminal *terminal, struct input_event *hold_quit) | |||
| 3166 | cancel_mouse_face (f); | 3178 | cancel_mouse_face (f); |
| 3167 | haiku_clear_under_internal_border (f); | 3179 | haiku_clear_under_internal_border (f); |
| 3168 | } | 3180 | } |
| 3181 | |||
| 3169 | break; | 3182 | break; |
| 3170 | } | 3183 | } |
| 3171 | case FRAME_EXPOSED: | 3184 | case FRAME_EXPOSED: |