]> git.eshelyaron.com Git - emacs.git/commitdiff
Clean up Haiku display structures
authorPo Lu <luangruo@yahoo.com>
Tue, 1 Feb 2022 05:39:28 +0000 (05:39 +0000)
committerPo Lu <luangruo@yahoo.com>
Tue, 1 Feb 2022 05:39:28 +0000 (05:39 +0000)
* src/haikufns.c (haiku_set_parent_frame): Set `parent_desc'
correctly.

* src/haikuterm.h (C_FRAME, C_FONT, C_TERMINAL):
(struct haiku_display_info):
(struct haiku_output): Get rid of C_* preprocessor defines,
since these files are no longer included in any way by C++ files.

src/haikufns.c
src/haikuterm.h

index 8f5dae1a2b93808d55d9c277739c4b0d26bc8e73..eb736f1153dcdde6ec8b4a857b04a0b026479862 100644 (file)
@@ -418,13 +418,20 @@ haiku_set_parent_frame (struct frame *f,
     }
 
   if (!NILP (old_value))
-    EmacsWindow_unparent (FRAME_HAIKU_WINDOW (f));
+    {
+      EmacsWindow_unparent (FRAME_HAIKU_WINDOW (f));
+      FRAME_OUTPUT_DATA (f)->parent_desc = NULL;
+    }
   if (!NILP (new_value))
     {
       EmacsWindow_parent_to (FRAME_HAIKU_WINDOW (f),
                             FRAME_HAIKU_WINDOW (p));
       BWindow_set_offset (FRAME_HAIKU_WINDOW (f),
                          f->left_pos, f->top_pos);
+
+      /* This isn't actually used for anything, but makes the
+        `parent-id' parameter correct.  */
+      FRAME_OUTPUT_DATA (f)->parent_desc = FRAME_HAIKU_WINDOW (p);
     }
   fset_parent_frame (f, new_value);
   unblock_input ();
index de302883e4865133938e95dbeee37d305e276dbc..de607e6dc51bd775c6f8741b0dabbc2a1cf90e37 100644 (file)
@@ -32,10 +32,6 @@ along with GNU Emacs.  If not, see <https://www.gnu.org/licenses/>.  */
 #include "font.h"
 #include "systime.h"
 
-#define C_FRAME struct frame *
-#define C_FONT struct font *
-#define C_TERMINAL struct terminal *
-
 #define HAVE_CHAR_CACHE_MAX 65535
 
 extern int popup_activated_p;
@@ -64,7 +60,7 @@ struct haiku_display_info
 {
   /* Chain of all haiku_display_info structures. */
   struct haiku_display_info *next;
-  C_TERMINAL terminal;
+  struct terminal *terminal;
 
   Lisp_Object name_list_element;
   Lisp_Object color_map;
@@ -86,7 +82,6 @@ struct haiku_display_info
   int n_planes;
   int color_p;
 
-  Window root_window;
   Lisp_Object rdb;
 
   Emacs_Cursor vertical_scroll_bar_cursor;
@@ -94,9 +89,9 @@ struct haiku_display_info
 
   Mouse_HLInfo mouse_highlight;
 
-  C_FRAME highlight_frame;
-  C_FRAME last_mouse_frame;
-  C_FRAME last_mouse_motion_frame;
+  struct frame *highlight_frame;
+  struct frame *last_mouse_frame;
+  struct frame *last_mouse_motion_frame;
 
   int last_mouse_motion_x;
   int last_mouse_motion_y;
@@ -110,6 +105,8 @@ struct haiku_display_info
   double resx, resy;
 
   Time last_mouse_movement_time;
+
+  Window root_window;
 };
 
 struct haiku_output
@@ -160,7 +157,7 @@ struct haiku_output
 
   int menu_bar_open_p;
 
-  C_FONT font;
+  struct font *font;
 
   int hourglass_p;
   uint32_t cursor_fg;