{
struct haiku_menu_bar_resize_event rq;
rq.window = this->Window ();
- rq.height = std::lrint (newHeight);
- rq.width = std::lrint (newWidth);
+ rq.height = std::lrint (newHeight + 1);
+ rq.width = std::lrint (newWidth + 1);
haiku_write (MENU_BAR_RESIZE, &rq);
BMenuBar::FrameResized (newWidth, newHeight);
fset_redisplay (f);
- FRAME_MENU_BAR_LINES (f) = 0;
- FRAME_MENU_BAR_HEIGHT (f) = 0;
-
if (nlines)
{
FRAME_EXTERNAL_MENU_BAR (f) = 1;
}
else
{
+ FRAME_MENU_BAR_LINES (f) = 0;
+ FRAME_MENU_BAR_HEIGHT (f) = 0;
+
if (FRAME_EXTERNAL_MENU_BAR (f))
free_frame_menubar (f);
+
FRAME_EXTERNAL_MENU_BAR (f) = 0;
- if (FRAME_HAIKU_P (f))
- FRAME_HAIKU_MENU_BAR (f) = 0;
+ FRAME_HAIKU_MENU_BAR (f) = 0;
}
adjust_frame_glyphs (f);
void
free_frame_menubar (struct frame *f)
{
+ void *mbar;
+
FRAME_MENU_BAR_LINES (f) = 0;
FRAME_MENU_BAR_HEIGHT (f) = 0;
FRAME_EXTERNAL_MENU_BAR (f) = 0;
block_input ();
- void *mbar = FRAME_HAIKU_MENU_BAR (f);
+ mbar = FRAME_HAIKU_MENU_BAR (f);
+ FRAME_HAIKU_MENU_BAR (f) = NULL;
+
if (mbar)
BMenuBar_delete (mbar);
+
if (FRAME_OUTPUT_DATA (f)->menu_bar_open_p)
--popup_activated_p;
FRAME_OUTPUT_DATA (f)->menu_bar_open_p = 0;
{
void *mbar = FRAME_HAIKU_MENU_BAR (f);
void *view = FRAME_HAIKU_VIEW (f);
-
- int first_time_p = 0;
+ bool first_time_p = false;
if (!mbar)
{
initial dimensions of that menu bar. */
if (FRAME_VISIBLE_P (f))
haiku_wait_for_event (f, MENU_BAR_RESIZE);
+
unblock_input ();
}
int old_height = FRAME_MENU_BAR_HEIGHT (f);
- FRAME_MENU_BAR_HEIGHT (f) = b->height + 1;
+ FRAME_MENU_BAR_HEIGHT (f) = b->height;
FRAME_MENU_BAR_LINES (f)
= (b->height + FRAME_LINE_HEIGHT (f)) / FRAME_LINE_HEIGHT (f);
- if (old_height != b->height + 1)
+ if (old_height != b->height)
{
adjust_frame_size (f, -1, -1, 3, true, Qmenu_bar_lines);
haiku_clear_under_internal_border (f);