summaryrefslogtreecommitdiff
path: root/src/haikufns.c
Commit message (Collapse)AuthorAgeFilesLines
* Improve frame synchronization support on HaikuPo Lu2022-08-011-3/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * src/ftcrfont.c (ftcrfont_draw): * src/haikufns.c (haiku_set_background_color): * src/haikuterm.c (haiku_clip_to_string): (haiku_clip_to_string_exactly): (haiku_clear_frame_area): (haiku_clear_frame): (haiku_draw_box_rect): (haiku_draw_relief_rect): (haiku_draw_underwave): (haiku_draw_text_decoration): (haiku_draw_plain_background): (haiku_draw_stipple_background): (haiku_draw_glyph_string_foreground): (haiku_draw_glyphless_glyph_string_foreground): (haiku_draw_stretch_glyph_string): (haiku_start_clip): (haiku_end_clip): (haiku_clip_to_row): (haiku_draw_composite_glyph_string_foreground): (haiku_draw_image_glyph_string): (haiku_draw_glyph_string): (haiku_after_update_window_line): (haiku_draw_hollow_cursor): (haiku_draw_bar_cursor): (haiku_draw_vertical_window_border): (haiku_draw_window_divider): (haiku_scroll_bar_create): (haiku_set_horizontal_scroll_bar): (haiku_set_vertical_scroll_bar): (haiku_draw_fringe_bitmap): (haiku_scroll_run): (haiku_read_socket): (haiku_flash): (haiku_clear_under_internal_border): (haiku_scroll_bar_remove): * src/haikuterm.h (MAKE_FRAME_DIRTY): (FRAME_CR_CONTEXT): Don't dirty frames if not necessary.
* Implement primitive frame synchronization on HaikuPo Lu2022-08-011-1/+12
| | | | | | | | | | | | | | | | | | | Instead of relying on a compositor to do the work, we simply wait for VBLANK and hope that the update finishes soon enough. * doc/lispref/frames.texi (Management Parameters): Document that frame synchronization is now supported on Haiku. * src/haiku_support.cc (class EmacsView): New field `use_frame_synchronization'. (FlipBuffers): Wait for vertical blanking period. (be_set_use_frame_synchronization): New function. * src/haiku_support.h: Update prototypes. * src/haikufns.c (haiku_create_frame): Set `use-frame-synchronization'. (haiku_set_use_frame_synchronization) (haiku_frame_parm_handlers): New param handler.
* Make frame synchronization a frame parameterPo Lu2022-08-011-0/+1
| | | | | | | | | | | | | | | | | | | | | * doc/lispref/frames.texi (Management Parameters): Document `use-frame-synchronization'. * etc/NEWS: Update entry. * src/frame.c (frame_parms): New frame parameter `use-frame-synchronization'. (syms_of_frame): New defsym. * src/haikufns.c (haiku_frame_parm_handlers): * src/nsfns.m (ns_frame_parm_handlers): * src/pgtkfns.c (pgtk_frame_parm_handlers): * src/w32fns.c (w32_frame_parm_handlers): Update frame param handlers correctly. * src/xfns.c (x_set_use_frame_synchronization): New function. (Fx_create_frame): Set default value of said parameter. (x_frame_parm_handlers): Add handler. * src/xterm.c (x_sync_wait_for_frame_drawn_event): Clear parameter if sync fails.
* Fix flicker when moving tooltips between frames during mouse drag-and-dropPo Lu2022-07-261-1/+0
| | | | | | | | * src/haikufns.c (Fx_show_tip): * src/nsfns.m (Fx_show_tip): Allow sharing existing tooltip frames between any two frames. * src/xfns.c (Fx_show_tip): Allow that but only between frames on the same X display.
* Apply tooltip assertions to all instances of x-show-tipPo Lu2022-07-211-2/+25
| | | | | | | | | | | * src/haikufns.c (Fx_show_tip): (syms_of_haikufns): * src/nsfns.m (Fx_show_tip): (syms_of_nsfns): * src/pgtkfns.c (Fx_show_tip): (syms_of_pgtkfns): * src/xfns.c (Fx_show_tip): (syms_of_xfns): Add assertion and adjust default values.
* Improve behavior of sticky tooltips on HaikuPo Lu2022-07-081-2/+2
| | | | | | | | | | | * src/haiku_support.cc (class EmacsView, MouseMoved): Remove `tooltip_position'. (class EmacsMotionSuppressionView): New class. (BView_set_and_show_sticky_tooltip): Rename to `be_show_sticky_tooltip'. Add motion suppression view. * src/haiku_support.h: Update prototypes. * src/haikufns.c (Fx_show_tip): Update for renamed function.
* Fix flickering system tooltips on HaikuPo Lu2022-07-081-3/+4
| | | | | | | * src/haiku_support.cc (class EmacsView, MouseMoved): Restore sticky status and mouse relative position. (BView_set_and_show_sticky_tooltip): * src/haikufns.c (haiku_hide_tip): Fix coding style.
* Use BASE_EQ when comparing with QunboundMattias EngdegÄrd2022-06-121-10/+10
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Qunbound is uninterned and can therefore never be EQ to any symbol with position. * src/buffer.c (Fbuffer_local_value, buffer_lisp_local_variables) (buffer_local_variables_1): * src/bytecode.c (exec_byte_code): * src/comp.c (compile_function, Fcomp__compile_ctxt_to_file): * src/composite.c (composition_gstring_cache_clear_font): * src/data.c (Fboundp, Fsymbol_value, set_internal) (Fdefault_boundp, Fdefault_value, Fmake_variable_buffer_local): * src/emacs-module.c (module_global_reference_p): * src/eval.c (Fdefault_toplevel_value, defvar) (run_hook_with_args): * src/fns.c (hash_put, Fmaphash): * src/font.c (font_put_extra): * src/frame.c (gui_set_frame_parameters) (gui_frame_get_and_record_arg, gui_default_parameter) (gui_figure_window_size): * src/haikufns.c (get_geometry_from_preferences) (haiku_create_frame, haiku_create_tip_frame): * src/haikuterm.c (haiku_draw_text_decoration) (haiku_default_font_parameter): * src/json.c (lisp_to_json_nonscalar_1): * src/keymap.c (access_keymap_1, access_keymap, current_minor_maps): * src/lread.c (readevalloop, define_symbol): * src/minibuf.c (read_minibuf, Ftry_completion): (Fall_completions, Ftest_completion): * src/pgtkfns.c (pgtk_default_font_parameter, Fx_create_frame) (x_create_tip_frame): * src/pgtkselect.c (Fpgtk_own_selection_internal): * src/print.c (print): * src/profiler.c (evict_lower_half, record_backtrace): * src/terminal.c (create_terminal): * src/textprop.c (set_properties): * src/w32fns.c (my_create_window, w32_icon) (w32_default_font_parameter, Fx_create_frame) (w32_create_tip_frame): * src/w32term.c (w32_draw_glyph_string): * src/xdisp.c (handle_single_display_spec) (cursor_row_fully_visible_p, calc_pixel_width_or_height): * src/xfns.c (x_default_scroll_bar_color_parameter, x_icon_verify) (x_icon, x_default_font_parameter, Fx_create_frame) (x_create_tip_frame): * src/xselect.c (x_handle_selection_request): * src/xterm.c (x_draw_glyph_string, x_term_init): Use BASE_EQ instead of EQ when comparing with Qunbound.
* Implement `follow-tooltip' for DND on HaikuPo Lu2022-06-091-0/+10
| | | | | | | | | | | | | | | | | * lisp/term/haiku-win.el (x-begin-drag): Implement `follow-tooltip'. * src/haikufns.c (Fx_show_tip): Record last dx and dy. (syms_of_haikufns): New staticpros. * src/haikuselect.c (haiku_unwind_drag_message): Clear new flag. (Fhaiku_drag_message): New argument `follow-tooltip'. Set new flag. (haiku_dnd_compute_tip_xy): New function. (haiku_note_drag_motion): Move tooltip if flag is true. * src/haikuterm.c (haiku_read_socket): Don't generate help event if mouse moves onto a tooltip during DND. * src/haikuterm.h: Update prototypes.
* Update frame positions on Haiku after changing Z groupPo Lu2022-05-301-0/+4
| | | | | | * src/haiku_support.cc (EmacsScreenChangeMonitor): Fix comment. * src/haikufns.c (haiku_set_z_group): Ask for a position update, since changing the Z group might change the feel of the window.
* Add more cursor bitmaps on HaikuPo Lu2022-05-281-1/+1
| | | | * src/haikufns.c (cursor_bitmaps_for_id): Add hourglass cursor.
* Fix cursor color adjustment on HaikuPo Lu2022-05-251-7/+1
| | | | | * src/haikufns.c (haiku_set_foreground_color): Maybe set cursor color correctly if it was equal to the old foreground color.
* Minor fixes to cursor color handling on HaikuPo Lu2022-05-241-61/+39
| | | | | | | | | | | * src/haikufns.c (haiku_decode_color): New function. (haiku_set_foreground_color, haiku_set_background_color) (haiku_set_cursor_color, haiku_set_mouse_color): Use that function to decode colors instead. Also set cursor GC foreground when setting background color. * src/haikuterm.c (haiku_merge_cursor_foreground): Fix color equality test.
* Compute frame workareas on HaikuPo Lu2022-05-211-0/+52
| | | | | | | | | | | | | | * lisp/frame.el (display-monitor-attributes-list): Implement specially on Haiku as well. * src/haiku_support.cc (get_zoom_rect): New function. Extract CalculateZoomRect here. (class EmacsWindow, SetFullscreen): Use that instead of CalculateZoomRect. (be_get_explicit_workarea): New function. * src/haiku_support.h: Update prototypes. * src/haikufns.c (Fhaiku_display_monitor_attributes_list): New function. (syms_of_haikufns): Register new subr.
* Fix specifying terminal names to some functions on HaikuPo Lu2022-05-191-3/+3
| | | | | * src/haikufns.c (haiku_display_info_for_name): Implement correctly.
* Fix race conditions processing frame fullscreen state on HaikuPo Lu2022-05-191-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | * doc/lispref/frames.texi (Size Parameters): Remove note saying Haiku doesn't support `fullwidth' and `fullboth'. * src/haiku_support.cc (subset_windows, class EmacsWindow) (Unparent, ParentTo): Stop calling old fullscreen functions. (ClearFullscreen, FullscreenRectForMode, SetFullscreen): New functions. Completely rewrite old zoom and fullscreen handling code. (Zoom): Send a ZOOM_EVENT and don't actually zoom. (BWindow_zoom, EmacsWindow_make_fullscreen, EmacsWindow_unzoom): Delete functions. (be_set_window_fullscreen_mode): New function. * src/haiku_support.h (struct haiku_zoom_event): Remove `zoomed_p' parameter. (enum haiku_fullscreen_mode): New enum. Update prototypes. * src/haikufns.c (Fx_display_pixel_height): Return height instead of width. * src/haikuterm.c (haiku_make_fullscreen_consistent) (haiku_read_socket, haiku_fullscreen): Adjust to always set zoom and fullscreen in the main thread instead of the UI threads. * src/haikuterm.h (struct haiku_output): Remove flag `zoomed_p' and add field `fullscreen_mode'.
* Implement gamma-correction on HaikuPo Lu2022-05-181-0/+16
| | | | | | | | * src/dispextern.h: Add `gamma_correct' prototype on Haiku as well. * src/haikufns.c (gamma_correct): New function. * src/haikuterm.c (haiku_defined_color): Gamma-correct colors if their pixels are being allocated.
* Fix race conditions when calculating Haiku frame geometryPo Lu2022-05-181-4/+9
| | | | | | | | | * src/haiku_support.cc (be_lock_window, be_unlock_window): New functions. * src/haiku_support.h: Update prototypes. * src/haikufns.c (frame_geometry): Lock window before asking for its dimensions and frame.
* Avoid race conditions when computing real frame positions on HaikuPo Lu2022-05-171-14/+7
| | | | | | | | | | | | | | | | * src/haiku_support.cc (DispatchMessage): Accept SEND_MOVE_FRAME_EVENT. (class EmacsWindow, FrameMoved): Include decorator frame in MOVE_EVENT events. (be_send_move_frame_event): New function. * src/haiku_support.h (struct haiku_move_event): Include decorator dimensions. Update prototypes. * src/haikufns.c (haiku_update_after_decoration_change): Ask for a move frame event and don't do anything if configury is not yet complete. * src/haikuterm.c (haiku_read_socket): Adjust accordingly.
* Rewrite Haiku frame geometry code to handle decorator framesPo Lu2022-05-171-40/+92
| | | | | | | | | | | | | | | | | | | | | | | | | | | * doc/lispref/frames.texi (Frame Layout): Document changes to Haiku frame layout. * src/haiku_support.cc (class EmacsWindow, MoveToIncludingFrame) (EmacsMoveTo, MakeFullscreen): Move to an offset including the decorator frames. (be_get_window_decorator_dimensions): (be_get_window_decorator_frame): New functions. * src/haiku_support.h: Update prototypes. * src/haikufns.c (haiku_update_after_decoration_change): New function. (haiku_create_frame, haiku_set_undecorated) (haiku_set_override_redirect): Call that function. (frame_geometry): Actually calculate frame geometry based on decorator and frame sizes. * src/haikuterm.c (haiku_coords_from_parent): Use frame width instead. (haiku_read_socket): Set left and top positions based on decorator width and height. * src/haikuterm.h (struct haiku_output): New field `frame_x' and `frame_y'.
* Add more cursor bitmaps on HaikuPo Lu2022-05-171-3/+3
| | | | | * src/haikufns.c (cursor_bitmaps_for_id): Add vertd, horizd and hand bitmaps.
* Simplify Haiku cursor management codePo Lu2022-05-151-2/+2
| | | | | | | | | | | | | * src/haiku_support.cc (BCursor_create_default) (BCursor_create_modeline, BCursor_from_id, BCursor_create_i_beam) (BCursor_create_progress_cursor, BCursor_create_grab) (BCursor_delete): Delete specialized cursor creation functions. (be_delete_cursor, be_create_cursor_from_id): New functions. (BView_set_view_cursor): Fix coding style. * src/haiku_support.h (enum haiku_cursor): Add all cursor IDs. * src/haikufns.c (haiku_free_custom_cursors): (haiku_set_mouse_color): * src/haikuterm.c (haiku_term_init): Adjust accordingly.
* Add more cursor bitmaps on HaikuPo Lu2022-05-141-4/+4
| | | | | | | | * src/haikufns.c (cursor_bitmaps): Register new cursor bitmaps. * src/haikugui.h (hand_ptr_bits, hand_ptrmask_bits) (horizd_ptr_bits, horizd_ptrmask_bits, vertd_ptr_bits) (vertd_ptrmask_bits, hourglass_bits, hourglass_mask_bits): New cursor bitmaps.
* Fix display class of tooltip frames on HaikuPo Lu2022-05-141-0/+20
| | | | | | * haikufns.c (haiku_create_tip_frame): Set up frame display class. (syms_of_haikufns): New symbols `mono', `grayscale' and `color'.
* Add more cursor bitmaps on HaikuPo Lu2022-05-131-44/+44
| | | | | | | | * src/haikufns.c (cursor_bitmaps, cursor_bitmaps_for_id): Register crosshair and xterm cursors. * src/haikugui.h (cross_ptr_bits, cross_ptrmask_bits) (ibeam_ptr_bits, ibeam_ptrmask_bits): New cursor bitmaps.
* Allow setting cursor colors for custom cursors on HaikuPo Lu2022-05-131-4/+52
| | | | | | | | * src/haikufns.c: (struct user_cursor_bitmap_info): (cursor_bitmaps): Fix hotspot for left arrow pointer. (cursor_bitmaps_for_id): New array. (haiku_set_mouse_color): If a color was specified, consult `cursor_bitmaps_for_id' for user-specified cursors.
* Allow actually setting cursor colors on HaikuPo Lu2022-05-131-24/+128
| | | | | | | | | | | | | | | | | | | * src/haiku_support.cc (be_create_pixmap_cursor): New function. * src/haiku_support.h: Update prototypes. * src/haikufns.c (haiku_create_frame): Change default cursor color to "font-color". (haiku_create_tip_frame): Likewise. (struct user_cursor_bitmap_info): New struct. (cursor_bitmaps): New list of bitmaps corresponding to cursors. (haiku_create_colored_cursor): New function. (haiku_free_custom_cursors): Set current cursor to the default cursor before freeing the original value. (haiku_set_mouse_color): Actually recolor cursors based on built-in bitmaps. * src/haikuterm.c (haiku_defined_color): Clean up coding style.
* Clean up Haiku display opening codePo Lu2022-05-121-12/+7
| | | | | | * src/haikufns.c (Fx_open_connection): (Fhaiku_frame_list_z_order): Improve error messages and fix coding style.
* Add support for changing pointer types on HaikuPo Lu2022-05-111-26/+147
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * doc/lispref/frames.texi (Pointer Shape): Document that the pointer shape can now be changed on some window systems other than X. * lisp/term/haiku-win.el (x-pointer-X-cursor, x-pointer-arrow) (x-pointer-bottom-left-corner, x-pointer-bottom-right-corner) (x-pointer-bottom-side, x-pointer-clock, x-pointer-cross) (x-pointer-cross-reverse, x-pointer-crosshair) (x-pointer-diamond-cross, x-pointer-hand1, x-pointer-hand2) (x-pointer-left-side, x-pointer-right-side) (x-pointer-sb-down-arrow, x-pointer-sb-left-arrow) (x-pointer-sb-right-arrow, x-pointer-sb-up-arrow, x-pointer-target) (x-pointer-top-left-corner, x-pointer-top-right-corner) (x-pointer-top-side, x-pointer-watch, x-pointer-invisible): New pointer constants. * src/haiku_support.cc (BCursor_from_id): Accept int instead of enum. * src/haiku_support.h: Update prototypes. * src/haikufns.c (haiku_create_frame): Stop manually assigning cursors and set default value of the mouse color property. (haiku_free_frame_resources): Free custom cursors too. (struct user_cursor_info, INIT_USER_CURSOR): New struct. (haiku_free_custom_cursors): New function. (haiku_set_mouse_color): New param handler. (haiku_frame_parm_handlers): Add param handler. (syms_of_haikufns): New cursor shape variables from X. * src/haikuterm.h: Update prototypes.
* Implement `sticky' frame parameter on HaikuPo Lu2022-05-071-1/+10
| | | | | | | * src/haiku_support.cc (BWindow_set_sticky): New function. * src/haiku_support.h: Update prototypes. * src/haikufns.c (haiku_set_sticky, haiku_frame_parm_handlers): New frame param handler.
* Fix calculation of display resolution on HaikuPo Lu2022-05-061-5/+9
| | | | | | | | | | | | | | * src/haiku_support.cc (BScreen_px_dim): Rename to `be_get_screen_dimensions'. (BScreen_res): Rename to `be_get_display_resolution' and fix resolution computation. * src/haiku_support.h: Update prototypes. * src/haikufns.c (compute_tip_xy, Fx_display_pixel_width) (Fx_display_pixel_height, Fx_display_mm_height) (Fx_display_mm_width): Update accordingly. * src/haikuterm.c (haiku_term_init): Likewise.
* Fix file name encoding on Haiku file dialogsPo Lu2022-05-041-2/+2
| | | | | * src/haikufns.c (Fhaiku_read_file_name): Use ENCODE_FILE and DECODE_FILE correctly.
* Encode and decode filenames correctly on HaikuPo Lu2022-05-041-2/+5
| | | | | * src/haikufns.c (Fhaiku_read_file_name): Decode file names correctly.
* Clean up Haiku file panel codePo Lu2022-05-041-39/+25
| | | | | | | | | | | | | | | | | | | | | | | * lisp/term/haiku-win.el (x-file-dialog): Fix nil values of `default-filename'. * src/haiku_io.c (haiku_len): Remove `FILE_PANEL_EVENT'. (record_c_unwind_protect_from_cxx, c_specpdl_idx_from_cxx) (c_unbind_to_nil_from_cxx): Delete functions. * src/haiku_support.cc (MessageReceived): Write pointer to buffer to file panel port instead. (struct popup_file_dialog_data): Delete strict. (unwind_popup_file_dialog): Delete functions. (be_popup_file_dialog): Accept a pointer to `process_pending_signals' and run nested event loop as usual. * src/haiku_support.h (enum haiku_event_type): Remove `FILE_PANEL_EVENT'. (struct haiku_file_panel_event): Delete struct. * src/haikufns.c (unwind_popup): Delete function. (Fhaiku_read_file_name): Update and quit on invalid filename. * src/haikuterm.c (struct unhandled_event): Delete struct. (haiku_read_socket): Remove "unhandled events".
* * src/haikufns.c (haiku_create_frame): Improve default border width.Po Lu2022-05-041-1/+1
|
* Fix race conditions with async input in some Haiku dialogsPo Lu2022-05-021-0/+2
| | | | | | * src/haikufns.c (Fhaiku_save_session_reply): * src/haikufont.c (Fx_select_font): Block sigio around system calls.
* Use x-show-tooltip-timeout in all the implementationsLars Ingebrigtsen2022-04-301-3/+2
| | | | | | | | | * src/haikufns.c (Fx_show_tip): Use the timeout variable. * src/pgtkfns.c (Fx_show_tip): Ditto. * src/w32fns.c (Fx_show_tip): Ditto. * src/xfns.c (Fx_show_tip): Doc fix.
* Fix colorspace calculations on HaikuPo Lu2022-04-291-26/+33
| | | | | | | | | | | | | | | | | | * src/haiku_support.cc (be_get_display_planes) (be_get_display_color_cells): Handle grayscale basic colorspaces correctly. (be_is_display_grayscale): New function. * src/haiku_support.h: Update prototypes. * src/haikufns.c (haiku_set_no_accept_focus, haiku_iconify_frame) (Fxw_display_color_p, Fxw_color_values, Fx_display_grayscale_p): Actually handle grayscale colorspaces. (Fx_display_pixel_width, Fx_display_pixel_height) (Fx_display_mm_height, Fx_display_mm_width): Clean up coding style. (Fx_display_visual_class): Handle grayscale colorspaces. (syms_of_haikufns): New defsyms.
* Add simple session management support to HaikuPo Lu2022-04-271-1/+26
| | | | | | | | | | | | | | | | | | | | | | * lisp/term/common-win.el (emacs-save-session-functions): Move from x-win.el to common-win.el. * lisp/term/haiku-win.el (haiku-save-session-reply) (emacs-session-save, handle-save-session): New functions. * lisp/term/x-win.el (emacs-save-session-functions): Delete. * src/haiku_font_support.cc (font_style_to_flags): * src/haiku_support.h (enum haiku_font_weight): Turn weight macros into enum. (struct haiku_font_pattern): Likewise. (struct haiku_session_manager_reply): New struct. * src/haiku_io.c (haiku_io_init): Create sm port. * src/haiku_support.cc (QuitRequested): Wait for reply from sm port. * src/haikufns.c (Fhaiku_save_session_reply): New function. (syms_of_haikufns): Define new subr. * src/haikuterm.c (haiku_read_socket): Send session management events. (haiku_term_init): Check new port.
* Cache relief colors on Haiku since their computation is expensivePo Lu2022-04-261-0/+2
| | | | | | | | | * src/haikufns.c (haiku_create_frame, haiku_create_tip_frame): Clear `relief_background'. * src/haikuterm.c (haiku_calculate_relief_colors): Cache relief colors for each frame. * src/haikuterm.h (struct haiku_output): New fields for caching the last relief color.
* Allow looking up window system colors on HaikuPo Lu2022-04-241-3/+35
| | | | | | | | | | | | * lisp/help-fns.el (help-fns--editable-variable): Fix describing variables which don't have symbol values. * lisp/term/haiku-win.el (haiku-allowed-ui-colors): Set list of allowed UI colors. * src/haiku_support.cc (be_get_ui_color): New function. * src/haiku_support.h: Update prototypes. * src/haikufns.c (haiku_get_color): Look for defined UI color. (syms_of_haikufns): New defvar `haiku-allowed-ui-colors'. * src/haikuterm.c (haiku_term_init): Fix coding style.
* Fix disabling double buffering on HaikuPo Lu2022-04-241-6/+3
| | | | | | | | * src/haikufns.c (haiku_set_inhibit_double_buffering): Garbage frame correctly after changing double buffering. * src/haikuterm.c (haiku_calculate_relief_colors) (haiku_draw_relief_rect, haiku_draw_underwave): Clean up coding style.
* Fix default frame name on HaikuPo Lu2022-04-221-48/+44
| | | | | | | | | | | | | | | | | | | * src/haikufns.c (haiku_set_background_color) (haiku_set_cursor_color, haiku_get_pixel, haiku_put_pixel) (haiku_set_internal_border_width) (haiku_set_inhibit_double_buffering) (Fhaiku_mouse_absolute_pixel_position, Fxw_color_defined_p) (Fxw_color_values, Fx_double_buffered_p) (Fx_display_backing_store): Clean up coding style. (haiku_set_name): Use correct default name and don't cons extra string all the time. * src/haikuterm.c (haiku_read_socket): Remove unused variable. (haiku_term_init): Set default name. (mark_haiku_display): Mark new field. * src/haikuterm.h (struct haiku_display_info): New field `default_name'.
* Implement `above' z-group on HaikuPo Lu2022-04-201-4/+45
| | | | | | | | | | | | | | | | * src/haiku_support.cc (class EmacsWindow): New field `z_group'. (RecomputeFeel): New function. (ParentTo, BWindow_set_override_redirect): Use that instead instead of manually juggling the window feel around. (BWindow_set_z_group): New function. * src/haiku_support.h (enum haiku_z_group): New enum. * src/haikufns.c (haiku_set_parent_frame): Clean up coding style. (haiku_set_z_group): New function. (haiku_create_frame): Always set z group after window creation, like on X. (haiku_frame_parm_handlers): Add `haiku_set_z_group'.
* Fix enabling menu bar multiple times on HaikuPo Lu2022-04-201-5/+5
| | | | | | | | | | | * src/haiku_support.cc (FrameResized): Adjust width and height appropriately when sending menu bar resize event. * src/haikufns.c (haiku_set_menu_bar_lines): Don't always reset FRAME_MENU_BAR_LINES and FRAME_MENU_BAR_HEIGHT. * src/haikumenu.c (free_frame_menubar): Clear Haiku menu bar. (set_frame_menubar): Fix coding style. * src/haikuterm.c (haiku_read_socket): Don't adjust height here anymore.
* Fix race conditions waiting for menu bar resize events on HaikuPo Lu2022-04-171-1/+5
| | | | | | | | | | | * src/haikufns.c (haiku_create_frame, haiku_create_tip_frame): Clear `wait_for_event_type'. (haiku_set_menu_bar_lines): Clean up coding style. * src/haikuterm.c (haiku_wait_for_event): New function. (haiku_read_socket): Implement waiting for MENU_BAR_RESIZE events. * src/haikuterm.h (struct haiku_output): New field `wait_for_event_type'.
* Get rid of unused flags on HaikuPo Lu2022-04-171-1/+1
| | | | | | | | | * src/haikufns.c (haiku_free_frame_resources): Syntax fixes. * src/haikumenu.c (set_frame_menubar, run_menu_bar_help_event): * src/haikuterm.c (haiku_read_socket): Stop setting and consulting `menu_up_to_date_p'. * src/haikuterm.h (struct haiku_output): Delete `menu_up_to_date_p'.
* * src/haikufns.c (haiku_free_frame_resources): Free saved menu event.Po Lu2022-04-171-0/+3
|
* Clean up various bits of Haiku codePo Lu2022-04-151-21/+19
| | | | | | | | | | | | | | | | | | | | * src/haiku_font_support.cc (BFont_string_width): Delete unused function. * src/haiku_support.cc (BWindow_new): Clean up type of `view'. (BWindow_quit): Clean up coding style. (BView_mouse_down, BView_mouse_up, BView_mouse_moved): Delete unused functions. (unwind_popup_file_dialog): Clean up coding style. (be_popup_file_dialog_safe_set_target): Delete function. (be_popup_file_dialog): Improve code clarity. * src/haiku_support.h: Fix coding style. * src/haikufns.c (haiku_get_color, haiku_display_info_for_name) (check_haiku_display_info, Fhaiku_read_file_name) (Fx_display_save_under, Fhaiku_frame_restack): Remove references to "Be displays" and replace them with "Haiku displays". * src/haikuselect.h: Clean up coding style. * src/haikuterm.c (haiku_read_socket): Clean up coding style and fix a few latent bugs.
* Minor cleanups to Haiku windowingPo Lu2022-04-131-3/+0
| | | | | | | | | * src/haikufns.c (haiku_create_frame, haiku_create_tip_frame): * src/haikuterm.h (struct haiku_output, struct scroll_bar) (XSCROLL_BAR): Remove used fields of various structs. * src/haikuterm.c (haiku_flash): Make input detection actually work.