emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

master 596d36f8cf: Fix menu bar position reporting on Haiku as well


From: Po Lu
Subject: master 596d36f8cf: Fix menu bar position reporting on Haiku as well
Date: Wed, 2 Mar 2022 06:10:45 -0500 (EST)

branch: master
commit 596d36f8cfd2c24df33668349cafbbf8a5ba1396
Author: Po Lu <luangruo@yahoo.com>
Commit: Po Lu <luangruo@yahoo.com>

    Fix menu bar position reporting on Haiku as well
    
    * src/haikuterm.c (haiku_toolkit_position): New function.
    (haiku_create_terminal): Register new hook.
---
 src/haikuterm.c | 10 ++++++++++
 1 file changed, 10 insertions(+)

diff --git a/src/haikuterm.c b/src/haikuterm.c
index a765eb715d..bdba6403ac 100644
--- a/src/haikuterm.c
+++ b/src/haikuterm.c
@@ -100,6 +100,15 @@ haiku_coords_from_parent (struct frame *f, int *x, int *y)
     }
 }
 
+static void
+haiku_toolkit_position (struct frame *f, int x, int y,
+                       bool *menu_bar_p, bool *tool_bar_p)
+{
+  if (FRAME_OUTPUT_DATA (f)->menubar)
+    *menu_bar_p = (x >= 0 && x < FRAME_PIXEL_WIDTH (f)
+                  && y >= 0 && y < FRAME_MENU_BAR_HEIGHT (f));
+}
+
 static void
 haiku_delete_terminal (struct terminal *terminal)
 {
@@ -3728,6 +3737,7 @@ haiku_create_terminal (struct haiku_display_info *dpyinfo)
   terminal->menu_show_hook = haiku_menu_show;
   terminal->toggle_invisible_pointer_hook = haiku_toggle_invisible_pointer;
   terminal->fullscreen_hook = haiku_fullscreen;
+  terminal->toolkit_position_hook = haiku_toolkit_position;
 
   return terminal;
 }



reply via email to

[Prev in Thread] Current Thread [Next in Thread]