diff options
| author | Po Lu | 2021-10-20 15:55:10 +0800 |
|---|---|---|
| committer | Juri Linkov | 2021-10-20 19:42:14 +0300 |
| commit | 8358da9c4c9079b93daffc1aebf3ea5e52b98593 (patch) | |
| tree | 1202627d1775d1e3fc2d55de71f874aca13dc493 /src | |
| parent | 29fdc65860e95a6e1c74147a3d310878080f6118 (diff) | |
| download | emacs-8358da9c4c9079b93daffc1aebf3ea5e52b98593.tar.gz emacs-8358da9c4c9079b93daffc1aebf3ea5e52b98593.zip | |
Display a tab bar item as sunken when appropriate
When the mouse pointer is pressed on the tab bar, moved out of the tab
bar, and moved back in, it would be more appropriate to behave like
other programs by displaying the item as sunken.
* src/xdisp.c (note_tab_bar_highlight): Display item as sunken if the
mouse pointer returns to the tab bar down.
Diffstat (limited to 'src')
| -rw-r--r-- | src/xdisp.c | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/src/xdisp.c b/src/xdisp.c index 97ba6721781..436153b2bae 100644 --- a/src/xdisp.c +++ b/src/xdisp.c | |||
| @@ -13861,12 +13861,17 @@ note_tab_bar_highlight (struct frame *f, int x, int y) | |||
| 13861 | 13861 | ||
| 13862 | bool mouse_down_p = false; | 13862 | bool mouse_down_p = false; |
| 13863 | #ifndef HAVE_NS | 13863 | #ifndef HAVE_NS |
| 13864 | /* Mouse is down, but on different tab-bar item? */ | 13864 | /* Mouse is down, but on different tab-bar item? Or alternatively, |
| 13865 | the mouse might've been pressed somewhere we don't know about, | ||
| 13866 | and then have moved onto the tab bar. In this case, | ||
| 13867 | last_tab_bar_item is -1, so we DTRT and behave like other | ||
| 13868 | programs by displaying the item as sunken. */ | ||
| 13865 | Display_Info *dpyinfo = FRAME_DISPLAY_INFO (f); | 13869 | Display_Info *dpyinfo = FRAME_DISPLAY_INFO (f); |
| 13866 | mouse_down_p = (gui_mouse_grabbed (dpyinfo) | 13870 | mouse_down_p = (gui_mouse_grabbed (dpyinfo) |
| 13867 | && f == dpyinfo->last_mouse_frame); | 13871 | && f == dpyinfo->last_mouse_frame); |
| 13868 | 13872 | ||
| 13869 | if (mouse_down_p && f->last_tab_bar_item != prop_idx) | 13873 | if (mouse_down_p && f->last_tab_bar_item != prop_idx |
| 13874 | && f->last_tab_bar_item != -1) | ||
| 13870 | return; | 13875 | return; |
| 13871 | #endif | 13876 | #endif |
| 13872 | draw = mouse_down_p ? DRAW_IMAGE_SUNKEN : DRAW_IMAGE_RAISED; | 13877 | draw = mouse_down_p ? DRAW_IMAGE_SUNKEN : DRAW_IMAGE_RAISED; |