diff options
| author | Dmitry Antipov | 2014-07-22 14:34:05 +0400 |
|---|---|---|
| committer | Dmitry Antipov | 2014-07-22 14:34:05 +0400 |
| commit | 1d3710228bb29e020ab4f179b0b14362bb5691b4 (patch) | |
| tree | 0e4a2e3a3b06a60f7a1a8a5b691edbb49c9a3b51 | |
| parent | c448c6241fd6cef424447dbfeaee18240aece27a (diff) | |
| download | emacs-1d3710228bb29e020ab4f179b0b14362bb5691b4.tar.gz emacs-1d3710228bb29e020ab4f179b0b14362bb5691b4.zip | |
* xterm.h (struct x_output) [USE_X_TOOLKIT || USE_GTK]: Define
menubar_height as such. Tweak comment.
(FRAME_MENUBAR_HEIGHT) [!USE_X_TOOLKIT && !USE_GTK]: No-op.
* xterm.c (handle_one_xevent):
* gtkutil.c (xg_event_is_for_menubar):
* xfns.c (x_window) [USE_X_TOOLKIT]:
* xmenu.c (set_frame_menubar, free_frame_menubar): Prefer
to use FRAME_MENUBAR_HEIGHT.
| -rw-r--r-- | src/ChangeLog | 11 | ||||
| -rw-r--r-- | src/gtkutil.c | 2 | ||||
| -rw-r--r-- | src/xfns.c | 6 | ||||
| -rw-r--r-- | src/xmenu.c | 4 | ||||
| -rw-r--r-- | src/xterm.c | 2 | ||||
| -rw-r--r-- | src/xterm.h | 14 |
6 files changed, 25 insertions, 14 deletions
diff --git a/src/ChangeLog b/src/ChangeLog index 30a02475262..84fe1f02560 100644 --- a/src/ChangeLog +++ b/src/ChangeLog | |||
| @@ -1,3 +1,14 @@ | |||
| 1 | 2014-07-22 Dmitry Antipov <dmantipov@yandex.ru> | ||
| 2 | |||
| 3 | * xterm.h (struct x_output) [USE_X_TOOLKIT || USE_GTK]: Define | ||
| 4 | menubar_height as such. Tweak comment. | ||
| 5 | (FRAME_MENUBAR_HEIGHT) [!USE_X_TOOLKIT && !USE_GTK]: No-op. | ||
| 6 | * xterm.c (handle_one_xevent): | ||
| 7 | * gtkutil.c (xg_event_is_for_menubar): | ||
| 8 | * xfns.c (x_window) [USE_X_TOOLKIT]: | ||
| 9 | * xmenu.c (set_frame_menubar, free_frame_menubar): Prefer | ||
| 10 | to use FRAME_MENUBAR_HEIGHT. | ||
| 11 | |||
| 1 | 2014-07-21 Dmitry Antipov <dmantipov@yandex.ru> | 12 | 2014-07-21 Dmitry Antipov <dmantipov@yandex.ru> |
| 2 | 13 | ||
| 3 | * frame.c (Fframe_parameters): Always report frame height without | 14 | * frame.c (Fframe_parameters): Always report frame height without |
diff --git a/src/gtkutil.c b/src/gtkutil.c index 752cc8ec60e..afa41f3269a 100644 --- a/src/gtkutil.c +++ b/src/gtkutil.c | |||
| @@ -3374,7 +3374,7 @@ xg_event_is_for_menubar (struct frame *f, const XEvent *event) | |||
| 3374 | if (! (event->xbutton.x >= 0 | 3374 | if (! (event->xbutton.x >= 0 |
| 3375 | && event->xbutton.x < FRAME_PIXEL_WIDTH (f) | 3375 | && event->xbutton.x < FRAME_PIXEL_WIDTH (f) |
| 3376 | && event->xbutton.y >= 0 | 3376 | && event->xbutton.y >= 0 |
| 3377 | && event->xbutton.y < f->output_data.x->menubar_height | 3377 | && event->xbutton.y < FRAME_MENUBAR_HEIGHT (f) |
| 3378 | && event->xbutton.same_screen)) | 3378 | && event->xbutton.same_screen)) |
| 3379 | return 0; | 3379 | return 0; |
| 3380 | 3380 | ||
diff --git a/src/xfns.c b/src/xfns.c index 868c5b68850..1bdb676af04 100644 --- a/src/xfns.c +++ b/src/xfns.c | |||
| @@ -2274,7 +2274,7 @@ x_window (struct frame *f, long window_prompting, int minibuffer_only) | |||
| 2274 | } | 2274 | } |
| 2275 | #endif | 2275 | #endif |
| 2276 | 2276 | ||
| 2277 | f->output_data.x->menubar_height = menubar_size; | 2277 | FRAME_MENUBAR_HEIGHT (f) = menubar_size; |
| 2278 | 2278 | ||
| 2279 | #ifndef USE_LUCID | 2279 | #ifndef USE_LUCID |
| 2280 | /* Motif seems to need this amount added to the sizes | 2280 | /* Motif seems to need this amount added to the sizes |
| @@ -2507,10 +2507,6 @@ x_window (struct frame *f) | |||
| 2507 | class_hints.res_class = SSDATA (Vx_resource_class); | 2507 | class_hints.res_class = SSDATA (Vx_resource_class); |
| 2508 | XSetClassHint (FRAME_X_DISPLAY (f), FRAME_X_WINDOW (f), &class_hints); | 2508 | XSetClassHint (FRAME_X_DISPLAY (f), FRAME_X_WINDOW (f), &class_hints); |
| 2509 | 2509 | ||
| 2510 | /* The menubar is part of the ordinary display; | ||
| 2511 | it does not count in addition to the height of the window. */ | ||
| 2512 | f->output_data.x->menubar_height = 0; | ||
| 2513 | |||
| 2514 | /* This indicates that we use the "Passive Input" input model. | 2510 | /* This indicates that we use the "Passive Input" input model. |
| 2515 | Unless we do this, we don't get the Focus{In,Out} events that we | 2511 | Unless we do this, we don't get the Focus{In,Out} events that we |
| 2516 | need to draw the cursor correctly. Accursed bureaucrats. | 2512 | need to draw the cursor correctly. Accursed bureaucrats. |
diff --git a/src/xmenu.c b/src/xmenu.c index eb98125f6bb..f4d0921762c 100644 --- a/src/xmenu.c +++ b/src/xmenu.c | |||
| @@ -1023,7 +1023,7 @@ set_frame_menubar (struct frame *f, bool first_time, bool deep_p) | |||
| 1023 | #endif /* USE_LUCID */ | 1023 | #endif /* USE_LUCID */ |
| 1024 | #endif /* 1 */ | 1024 | #endif /* 1 */ |
| 1025 | 1025 | ||
| 1026 | f->output_data.x->menubar_height = menubar_size; | 1026 | FRAME_MENUBAR_HEIGHT (f) = menubar_size; |
| 1027 | } | 1027 | } |
| 1028 | #endif /* not USE_GTK */ | 1028 | #endif /* not USE_GTK */ |
| 1029 | 1029 | ||
| @@ -1066,7 +1066,7 @@ free_frame_menubar (struct frame *f) | |||
| 1066 | 1066 | ||
| 1067 | menubar_widget = f->output_data.x->menubar_widget; | 1067 | menubar_widget = f->output_data.x->menubar_widget; |
| 1068 | 1068 | ||
| 1069 | f->output_data.x->menubar_height = 0; | 1069 | FRAME_MENUBAR_HEIGHT (f) = 0; |
| 1070 | 1070 | ||
| 1071 | if (menubar_widget) | 1071 | if (menubar_widget) |
| 1072 | { | 1072 | { |
diff --git a/src/xterm.c b/src/xterm.c index c3eb0028206..98737951022 100644 --- a/src/xterm.c +++ b/src/xterm.c | |||
| @@ -6834,7 +6834,7 @@ handle_one_xevent (struct x_display_info *dpyinfo, | |||
| 6834 | && event->xbutton.x >= 0 | 6834 | && event->xbutton.x >= 0 |
| 6835 | && event->xbutton.x < FRAME_PIXEL_WIDTH (f) | 6835 | && event->xbutton.x < FRAME_PIXEL_WIDTH (f) |
| 6836 | && event->xbutton.y >= 0 | 6836 | && event->xbutton.y >= 0 |
| 6837 | && event->xbutton.y < f->output_data.x->menubar_height | 6837 | && event->xbutton.y < FRAME_MENUBAR_HEIGHT (f) |
| 6838 | && event->xbutton.same_screen) | 6838 | && event->xbutton.same_screen) |
| 6839 | { | 6839 | { |
| 6840 | if (!f->output_data.x->saved_menu_event) | 6840 | if (!f->output_data.x->saved_menu_event) |
diff --git a/src/xterm.h b/src/xterm.h index 0de9c99ab8f..398d70fc8fc 100644 --- a/src/xterm.h +++ b/src/xterm.h | |||
| @@ -428,11 +428,11 @@ extern void select_visual (struct x_display_info *); | |||
| 428 | 428 | ||
| 429 | struct x_output | 429 | struct x_output |
| 430 | { | 430 | { |
| 431 | /* Height of menu bar widget, in pixels. | 431 | #if defined (USE_X_TOOLKIT) || defined (USE_GTK) |
| 432 | Zero if not using the X toolkit. | 432 | /* Height of menu bar widget, in pixels. This value |
| 433 | When using the toolkit, this value is not meaningful | 433 | is not meaningful if the menubar is turned off. */ |
| 434 | if the menubar is turned off. */ | ||
| 435 | int menubar_height; | 434 | int menubar_height; |
| 435 | #endif | ||
| 436 | 436 | ||
| 437 | /* Height of tool bar widget, in pixels. top_height is used if tool bar | 437 | /* Height of tool bar widget, in pixels. top_height is used if tool bar |
| 438 | at top, bottom_height if tool bar is at the bottom. | 438 | at top, bottom_height if tool bar is at the bottom. |
| @@ -714,10 +714,14 @@ enum | |||
| 714 | #endif /* !USE_GTK */ | 714 | #endif /* !USE_GTK */ |
| 715 | #endif | 715 | #endif |
| 716 | 716 | ||
| 717 | #if defined (USE_X_TOOLKIT) || defined (USE_GTK) | ||
| 718 | #define FRAME_MENUBAR_HEIGHT(f) ((f)->output_data.x->menubar_height) | ||
| 719 | #else | ||
| 720 | #define FRAME_MENUBAR_HEIGHT(f) ((void) f, 0) | ||
| 721 | #endif /* USE_X_TOOLKIT || USE_GTK */ | ||
| 717 | 722 | ||
| 718 | #define FRAME_FONT(f) ((f)->output_data.x->font) | 723 | #define FRAME_FONT(f) ((f)->output_data.x->font) |
| 719 | #define FRAME_FONTSET(f) ((f)->output_data.x->fontset) | 724 | #define FRAME_FONTSET(f) ((f)->output_data.x->fontset) |
| 720 | #define FRAME_MENUBAR_HEIGHT(f) ((f)->output_data.x->menubar_height) | ||
| 721 | #define FRAME_TOOLBAR_TOP_HEIGHT(f) ((f)->output_data.x->toolbar_top_height) | 725 | #define FRAME_TOOLBAR_TOP_HEIGHT(f) ((f)->output_data.x->toolbar_top_height) |
| 722 | #define FRAME_TOOLBAR_BOTTOM_HEIGHT(f) \ | 726 | #define FRAME_TOOLBAR_BOTTOM_HEIGHT(f) \ |
| 723 | ((f)->output_data.x->toolbar_bottom_height) | 727 | ((f)->output_data.x->toolbar_bottom_height) |