diff options
| author | Yuuki Harano | 2021-12-11 22:03:01 +0900 |
|---|---|---|
| committer | Yuuki Harano | 2021-12-11 22:03:01 +0900 |
| commit | b9c1e1d73bbaf9228867dad2885ca6de53a3175f (patch) | |
| tree | 3e76342dcd0c2855e8db6f659cee3cad212237ad /src | |
| parent | 9be1a841e59e7975195cb3e2f52855172bb46608 (diff) | |
| download | emacs-b9c1e1d73bbaf9228867dad2885ca6de53a3175f.tar.gz emacs-b9c1e1d73bbaf9228867dad2885ca6de53a3175f.zip | |
Implement pgtk_frame_raise_lower
* src/pgtkterm.c (pgtk_raise_frame): New function.
(pgtk_lower_frame): New function.
(pgtk_frame_raise_lower): New function to call one of those.
(pgtk_create_terminal): Set frame_raise_lower_hook.
Diffstat (limited to 'src')
| -rw-r--r-- | src/pgtkterm.c | 38 |
1 files changed, 37 insertions, 1 deletions
diff --git a/src/pgtkterm.c b/src/pgtkterm.c index c502905926f..ed9d086273f 100644 --- a/src/pgtkterm.c +++ b/src/pgtkterm.c | |||
| @@ -195,6 +195,42 @@ frame_set_mouse_pixel_position (struct frame *f, int pix_x, int pix_y) | |||
| 195 | { | 195 | { |
| 196 | } | 196 | } |
| 197 | 197 | ||
| 198 | /* Raise frame F. */ | ||
| 199 | |||
| 200 | static void | ||
| 201 | pgtk_raise_frame (struct frame *f) | ||
| 202 | { | ||
| 203 | /* This works only for non-child frames on X. | ||
| 204 | It does not work for child frames on X, and it does not work | ||
| 205 | on Wayland too. */ | ||
| 206 | block_input (); | ||
| 207 | if (FRAME_VISIBLE_P (f)) | ||
| 208 | gdk_window_raise (gtk_widget_get_window (FRAME_WIDGET (f))); | ||
| 209 | unblock_input (); | ||
| 210 | } | ||
| 211 | |||
| 212 | /* Lower frame F. */ | ||
| 213 | |||
| 214 | static void | ||
| 215 | pgtk_lower_frame (struct frame *f) | ||
| 216 | { | ||
| 217 | if (FRAME_VISIBLE_P (f)) | ||
| 218 | { | ||
| 219 | block_input (); | ||
| 220 | gdk_window_lower (gtk_widget_get_window (FRAME_WIDGET (f))); | ||
| 221 | unblock_input (); | ||
| 222 | } | ||
| 223 | } | ||
| 224 | |||
| 225 | static void | ||
| 226 | pgtk_frame_raise_lower (struct frame *f, bool raise_flag) | ||
| 227 | { | ||
| 228 | if (raise_flag) | ||
| 229 | pgtk_raise_frame (f); | ||
| 230 | else | ||
| 231 | pgtk_lower_frame (f); | ||
| 232 | } | ||
| 233 | |||
| 198 | /* Free X resources of frame F. */ | 234 | /* Free X resources of frame F. */ |
| 199 | 235 | ||
| 200 | void | 236 | void |
| @@ -4671,7 +4707,7 @@ pgtk_create_terminal (struct pgtk_display_info *dpyinfo) | |||
| 4671 | terminal->mouse_position_hook = pgtk_mouse_position; | 4707 | terminal->mouse_position_hook = pgtk_mouse_position; |
| 4672 | terminal->frame_rehighlight_hook = XTframe_rehighlight; | 4708 | terminal->frame_rehighlight_hook = XTframe_rehighlight; |
| 4673 | terminal->buffer_flipping_unblocked_hook = pgtk_buffer_flipping_unblocked_hook; | 4709 | terminal->buffer_flipping_unblocked_hook = pgtk_buffer_flipping_unblocked_hook; |
| 4674 | /* terminal->frame_raise_lower_hook = pgtk_frame_raise_lower; */ | 4710 | terminal->frame_raise_lower_hook = pgtk_frame_raise_lower; |
| 4675 | terminal->frame_visible_invisible_hook = pgtk_make_frame_visible_invisible; | 4711 | terminal->frame_visible_invisible_hook = pgtk_make_frame_visible_invisible; |
| 4676 | terminal->fullscreen_hook = pgtk_fullscreen_hook; | 4712 | terminal->fullscreen_hook = pgtk_fullscreen_hook; |
| 4677 | terminal->menu_show_hook = pgtk_menu_show; | 4713 | terminal->menu_show_hook = pgtk_menu_show; |