summaryrefslogtreecommitdiff
path: root/src/frame.h
Commit message (Collapse)AuthorAgeFilesLines
* Revert "Cleanup tooltips"John Wiegley2016-07-121-9/+0
| | | | | | | | This reverts commit 20038f8ab75dd1551412a43cd58520c483c22921. I am reverting this change because it was applied without prior discussion on emacs-devel, and has been found to break the NS port. It needs more testing and review before it should be applied here.
* Cleanup tooltipsDmitry Antipov2016-07-121-0/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * src/dispextern.h (toplevel): Remove 'tip_frame' and 'tip_window' decls. * src/frame.h (struct frame): New bitfield to indicate tooltip frame. (FRAME_TOOLTIP_P): New macro. * src/frame.c (make_frame): Mark new frame as regular frame by default. (Fframe_list, delete_frame): Redesign to use FRAME_TOOLTIP_P. (syms_of_frame): Don't DEFSYM 'Qtooltip' but use 'Qtooltip_timer' and 'Qtooltip_parameters' instead. * src/gtkutil.h (toplevel): Add 'xg_hide_tip' decl. * src/gtkutil.c (xg_hide_tip): New function. (xg_hide_tooltip): Adjust to cancel GTK event loop timeout if needed. * src/menu.c (Fx_popup_menu): Adjust call to Fx_hide_tip. * src/nsfns.c (toplevel): Remove 'tip_frame' leftover. * src/w32fns.c (unwind_create_tip_frame): Remove. (w32_display_monitor_attributes_list) (w32_display_monitor_attributes_list_fallback): Use FRAME_TOOLTIP_P. (toplevel): Remove 'tip_frame', 'tip_window' and 'last_show_tip_args'. (x_create_tip_frame): Use do_unwind_create_frame. Mark new frame as a tooltip frame and record it using appropriate display info. (x_hide_tooltip): Add frame arg. (Fx_show_tip): Adjust to avoid globals, store tooltip parameters among base frame parameters, store tooltip hide timer among tooltip frame parameters. (Fx_hide_tip): Add frame arg, hide tooltips on all displays by default. (syms_of_w32fns): Don't DEFSYM 'Qtip_frame', don't initialize and GC-protect 'tip_timer', 'tip_frame' and 'last_show_tip_args'. * src/w32term.c (w32_read_socket): Extract tooltip window id from per-display data. Use FRAME_TOOLTIP_P where appropriate. (x_new_font): Use FRAME_TOOLTIP_P. (x_free_frame_resources): Reset pointer to tooltip frame. * src/w32term.h (struct w32_display_info): New member 'w32_tooltip_frame'. * src/xdisp.c (init_iterator, x_consider_frame_title, prepare_menu_bars): Use FRAME_TOOLTIP_P. * src/xfns.c (x_make_monitor_attribute_list) (Fx_display_monitor_attributes_list): Likewise. (unwind_create_tip_frame): Remove. (toplevel): Remove 'tip_frame', 'tip_window' and 'last_show_tip_args'. (x_create_tip_frame): Use do_unwind_create_frame. Mark new frame as a tooltip frame and record it using appropriate display info. (x_hide_tooltip): Add frame arg. (Fx_show_tip): Adjust to avoid globals, store tooltip parameters among base frame parameters, store tooltip hide timer among tooltip frame parameters. To hide GTK system tooltip, use timeout hooked into GTK event loop. (Fx_hide_tip): Add frame arg, hide tooltips on all displays by default. (syms_of_xfns): Don't DEFSYM 'Qtip_frame', don't initialize and GC-protect 'tip_timer', 'tip_frame' and 'last_show_tip_args'. * src/xterm.c (handle_one_xevent): Extract tooltip window id from per-display data. Use FRAME_TOOLTIP_P where appropriate. (x_new_font, x_set_window_size): Use FRAME_TOOLTIP_P. (x_free_frame_resources): Reset pointer to tooltip frame. * src/xterm.h (struct x_display_info): New member 'x_tooltip_frame'. (struct x_output) [USE_GTK_TOOLTIP]: New member 'ttip_timeout'.
* Improve --without-x GCC pacificationPaul Eggert2016-06-221-30/+66
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * src/composite.c (autocmp_chars): * src/conf_post.h (DebPrint) [HAVE_NTGUI && !DebPrint && !EMACSDEBUG]: Use simpler ((void) 0) for no-op expression returning void. * src/dispextern.h [HAVE_WINDOW_SYSTEM]: Include fontset.h, for face_for_char. (FACE_SUITABLE_FOR_ASCII_CHAR_P, FACE_FOR_CHAR): Now inline functions instead of macros. This avoids the need for all those casts to void. (FACE_SUITABLE_FOR_ASCII_CHAR_P): Omit 2nd (unused) arg. All uses changed. * src/frame.c (Ficonify_frame, Fset_frame_position): * src/xdisp.c (Fmove_point_visually, show_mouse_face): * src/xdisp.c (note_mode_line_or_margin_highlight) (note_mouse_highlight): Assume HAVE_WINDOW_SYSTEM for simplicity, since the code should now work either way without generating warnings. * src/frame.c (display_available) [HAVE_WINDOW_SYSTEM]: New function. (window_system_available) [HAVE_WINDOW_SYSTEM]: Move to frame.h. (decode_window_system_frame): Use check_window_system instead of rolling the code ourself. Return needed only if HAVE_WINDOW_SYSTEM. (decode_window_system_frame, check_window_system): Merge the HAVE_WINDOW_SYSTEM and !HAVE_WINDOW_SYSTEM versions into one. * src/frame.c (Ficonify_frame, Fset_frame_position): * src/xdisp.c (show_mouse_face, define_frame_cursor1) (note_mouse_highlight): Narrow the scope of the HAVE_WINDOW_SYSTEM #ifdef; this is a better way to pacify GCC. * src/xdisp.c (x_set_left_fringe, x_set_right_fringe) (x_set_right_divider_width, x_set_bottom_divider_width): * src/xfns.c (x_set_internal_border_width): Don’t use what are now function calls as lvalues. * src/frame.h (WINDOW_SYSTEM_RETURN): New macro. (decode_window_system_frame, check_window_system): Use it, to avoid the need for duplicate declarations. (window_system_available): Now an inline function. (display_available): New decl. (frame_dimension): New inline function. (FRAME_FRINGE_COLS, FRAME_LEFT_FRINGE_WIDTH) (FRAME_RIGHT_FRINGE_WIDTH, FRAME_TOTAL_FRINGE_WIDTH) (FRAME_INTERNAL_BORDER_WIDTH, FRAME_RIGHT_DIVIDER_WIDTH) (FRAME_BOTTOM_DIVIDER_WIDTH): Use it, to avoid the need for duplicate definitions. Now inline functions instead of macros. * src/gnutls.c (gnutls_log_function2i): Remove. * src/gnutls.h (GNUTLS_LOG2i): Use ‘message’ directly. This avoids complaints about gnutls_log_function2i being defined and not used on older platforms that do not need to call GNUTLS_LOG2i. * src/image.c (DefaultDepthOfScreen) [0]: Remove unused macro. * src/lisp.h (AUTO_STRING_WITH_LEN): Revert change from ‘type id = expr’ to ‘type id; id = expr’, as this would suppress valid jump-misses-init diagnostics. Let’s find a better way to address the problem. * src/vm-limit.c (__MALLOC_HOOK_VOLATILE): Define only if needed. * src/xdisp.c (handle_single_display_spec): Simplify fringe_bitmap computation. (define_frame_cursor1): Do nothing unless in a window system. All callers changed and simplified. * src/xfaces.c (realize_default_face): Use a simpler way to pacify GCC when a return value is not used on some platforms.
* Fix compiler warnings in no-window-system-buildKen Brown2016-06-201-9/+11
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * src/composite.c (autocmp_chars): Declare and set 'f' only if HAVE_WINDOW_SYSTEM. * src/dispextern.h (FACE_SUITABLE_FOR_ASCII_CHAR_P) (FACE_FOR_CHAR): Explicitly discard unused arguments. * src/font.c (font_open_entity): Declare 'min_width' where it is first set, and only if HAVE_WINDOW_SYSTEM. * src/frame.c [!HAVE_WINDOW_SYSTEM] (decode_window_system_frame): Define _Noreturn version to avoid "suggest attribute noreturn" compiler warning. (check_window_system): Declare as _Noreturn. (Ficonify_frame): (Fset_frame_position): Don’t declare and set 'f'. * src/frame.h [!HAVE_WINDOW_SYSTEM] (decode_window_system_frame) (check_window_system): Add _Noreturn prototypes. (FRAME_FRINGE_COLS, FRAME_TOTAL_FRINGE_WIDTH) (FRAME_LEFT_FRINGE_WIDTH, FRAME_RIGHT_FRINGE_WIDTH) (FRAME_INTERNAL_BORDER_WIDTH, FRAME_RIGHT_DIVIDER_WIDTH) (FRAME_BOTTOM_DIVIDER_WIDTH): Explicitly discard unused argument. * src/xdisp.c (handle_single_display_spec): Declare 'fringe_bitmap' only if HAVE_WINDOW_SYSTEM. (append_space_for_newline): Declare 'g' where it is first set. (Fmove_point_visually): Declare and set 'target_is_eol_p' only if HAVE_WINDOW_SYSTEM. (show_mouse_face): Declare and set 'f' and 'phys_cursor_on_p' only if HAVE_WINDOW_SYSTEM. (note_mode_line_or_margin_highlight): (note_mouse_highlight): Declare and set 'cursor' and 'pointer' only if HAVE_WINDOW_SYSTEM. * src/xfaces.c (realize_default_face): Declare and set 'face' only if HAVE_X_WINDOWS. Remove redundant #ifdef.
* New macro GNUC_PREREQ for GCC versionPaul Eggert2016-06-121-1/+1
| | | | | | | | | | * src/conf_post.h (GNUC_PREREQ): New macro. Change uses of __GNUC_MINOR__ and __GNUC_PATCHLEVEL__ to use this macro instead, for clarity and consistency. (PRINTF_ARCHETYPE): New macro. Define it to __gnu_printf__ only if glibc, since non-GNU platforms don’t necessarily support GNU printf formats. (ATTRIBUTE_FORMAT_PRINTF): Use it.
* Merge from origin/emacs-25John Wiegley2016-03-111-2/+2
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | facb5e2 Update Emacs manual section related to character folding 4efea8e ; * etc/DEBUG: Fix a typo. (Bug#22984) f8df21b Update admin/notes/unicode 950be68 Add symref-filepattern entries for c?perl-mode 8b8a6ad Don't use XRANDR 1.3 extensions if the server doesn't support them. 985dacf ; NEWS update for the last change in etags 741a6f8 Sync with gnulib 7352c6c Rework C source files to avoid ^( a589e9a By default, etags produces unqualified Perl tag names 72c7438 Indent methods with keyword names correctly 28532a9 Propertize character literals and special global variables differently a7d6f39 ; Fix last change in NEWS 83b2a20 Change how /etc/NEWS presents character folding b417c5a Revert "Revert "Backport: * lisp/isearch.el: Turn char-folding off by default"" 711ca36 Properly handle lambda as read function (bug 22961) 1b9d616 Propertize operator symbol names with symbol syntax class 9b16bc2 Stop recognizing :#{} as symbol in ruby-mode 366ec77 Allow using the left shift operator without spaces on both sides 02bf7cc Properly handle unquoting in wdired (bug 22938) 16cf469 ; Spelling fix and tighten up comment f50bc04 Allow splat operator before percent literal 991c801 Don't apply the return value of goto-char as syntax class 6e63b3e Guard against nested percent literals 066f3bc Recognize iuwu-mod after an escaped newline 6f7a57c Fix symbolic mode string conversion for s and t 50b9826 Update 'ucs-names' database 993b2fb Improve doc string of 'shell-command' b71c717 Make the code in movemail_strftime more general cc057e4 Speed up redisplay of binary files with long series of nulls e51b27e Remove the highlighting support for quoting 'like this' inside Lisp docstrings b1abce1 Restore leading space in movemail pop output 98b8d44 Fix bidi-paragraph-direction in Rmail view buffer dc9d837 Don't misindent computed property generator methods 7923112 Fix mbox files produced by movemail on MS-Windows c45a1ca doc string file descriptor exhaustion fix 265141b Fix Bug#22814
| * Rework C source files to avoid ^(Paul Eggert2016-03-101-2/+2
| | | | | | | | | | | | | | | | Work around Bug#22884 by rewording comments and strings to avoid ‘(’ at the start of a line unless it starts a function. This change is a short-term hack; in the longer run we plan to fix cc-mode’s performance for C files that have ‘(’ at the start of a line in a comment or string.
* | Minor cleanups for async DNS etc.Paul Eggert2016-02-231-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * src/frame.h (FRAME_WINDOW_CONFIGURATION_CHANGED): Omit unnecessary parens. * src/gnutls.c (gnutls_try_handshake, emacs_gnutls_deinit) (gnutls_verify_boot): Use bool for boolean. (ATTRIBUTE_FORMAT_PRINTF): Add printf attribute. * src/process.c (free_dns_request, Fmake_network_process): Allocate and free async request control block all in one go. (set_network_socket_coding_system, finish_after_tls_connection) (connect_network_socket): Now static. (conv_numerical_to_lisp): 2nd arg is now int, not unsigned. (Fmake_network_process): Use list1 for brevity. (wait_for_socket_fds): 2nd arg is now const ptr. * src/process.h (struct Lisp_Process.dns_request): Now struct gaicb *, not struct gaicb **, since there was always exactly one. All uses changed. * src/window.c, src/window.h (run_window_configuration_change_hook): Now static.
* | Fix `window-configuration-change-hook' and `window-size-change-functions'Martin Rudalics2016-02-231-6/+7
|/ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | (1) Run `window-configuration-change-hook' if and only if at least one window was deleted or created or shows another buffer since last redisplay. (2) Run `window-size-change-functions' if and only if at least one window changed its size since last redisplay (in a few cases `window-size-change-functions' will also run when no window changed its size). (3) Provide two functions `window-pixel-height-before-size-change' and `window-pixel-width-before-size-change' that allow to easily detect which window changed size. * src/frame.h (struct frame): New boolean member window_configuration_changed. (FRAME_WINDOW_SIZES_CHANGED): Remove macro. (FRAME_WINDOW_CONFIGURATION_CHANGED): New macro. * src/frame.c (adjust_frame_size): Don't run `window-configuration-change-hook'. * src/window.h (struct window): New fields pixel_width_before_size_change and pixel_height_before_size_change. (WINDOW_INTERNAL_P): New macro. * src/window.c (Fwindow_pixel_width_before_size_change) (Fwindow_pixel_height_before_size_change): New functions. (Fdelete_other_windows_internal, Fwindow_resize_apply) (resize_frame_windows, Fsplit_window_internal) (Fdelete_window_internal, grow_mini_window) (shrink_mini_window, Fresize_mini_window_internal): Don't call FRAME_WINDOW_SIZES_CHANGED. (window_size_changed, window_set_before_size_change_sizes) (run_window_size_change_functions): New functions. (make_window): Initialize pixel_width_before_size_change and pixel_height_before_size_change. (Fdelete_window_internal): Don't call run_window_configuration_change_hook. (struct saved_window): Add pixel_height_before_size_change and pixel_width_before_size_change. (Fset_window_configuration): Try to identify window configuration changes correctly so run_window_configuration_change_hook and run_window_size_change_functions run only if configuration and size really changed. (save_window_save): Set the pixel_height_before_size_change and pixel_width_before_size_change fields. (Vwindow_size_change_functions): Move here definiton from xdisp.c. * src/xdisp.c (prepare_menu_bars, redisplay_internal): Call run_window_size_change_functions. (Vwindow_size_change_functions): Move definition to window.c. * src/xfns.c (x_set_menu_bar_lines): Don't call run_window_configuration_change_hook. * doc/lispref/windows.texi (Window Sizes): Document new functions `window-pixel-height-before-size-change' and `window-pixel-width-before-size-change'. (Window Configurations): Mention that this may trigger execution of `window-size-change-functions' although no window changed size. (Window Hooks): Update descriptions of `window-size-change-functions' and `window-configuration-change-hook'.
* Update copyright year to 2016Paul Eggert2016-01-011-1/+1
| | | | Run admin/update-copyright.
* Include-file cleanup for src directoryPaul Eggert2015-10-201-5/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Omit ‘#include "foo.h"’ unless the file needs foo.h (Bug#21707). In a few cases, add ‘#include "foo.h"’ if the file needs foo.h but does not include it directly. As a general rule, a source file should include foo.h if it needs the interfaces that foo.h defines. * src/alloc.c: Don’t include process.h. Include dispextern.h, systime.h. * src/atimer.c: Don’t include blockinput.h. * src/buffer.c: Include coding.h, systime.h. Don’t include keyboard.h, coding.h. * src/callint.c: Don’t include commands.h, keymap.h. * src/callproc.c: Don’t include character.h, ccl.h, composite.h, systty.h, termhooks.h. * src/casetab.c: Don’t include character.h. * src/category.c: Don’t include charset.h, keymap.h. * src/ccl.h: Don’t include character.h. * src/character.c: Don’t include charset.h. * src/charset.c: Don’t include disptab.h. * src/chartab.c: Don’t include ccl.h. * src/cm.c: Don’t include frame.h, termhooks.h. * src/cmds.c: Don’t include window.h, dispextern.h. * src/coding.c: Don’t include window.h, frame.h. * src/composite.c: Include composite.h. Don’t include window.h, font.h. * src/data.c: Don’t include syssignal.h, termhooks.h, font.h. * src/dbusbind.c: Don’t include frame.h. * src/decompress.c: Don’t include character.h. * src/dired.c: Don’t include character.h, commands.h, charset.h. * src/dispnew.c: Don’t include character.h, indent.h, intervals.h, process.h, timespec.h. Include systime.h. * src/doc.c: Include coding.h. Don’t include keyboard.h. * src/editfns.c: Include composite.h. Don’t include frame.h. * src/emacs.c: Include fcntl.h, coding.h. Don’t include commands.h, systty.h.. * src/fileio.c: Don’t include intervals.h, dispextern.h. Include composite.h. * src/filelock.c: Don’t include character.h, systime.h. * src/fns.c: Don’t include time.h, commands.h, keyboard.h, keymap.h, frame.h, blockinput.h, xterm.h. Include composite.h. * src/font.c: Include termhooks.h. * src/font.h: Don’t include ccl.h, frame.h. Add forward decls of struct composition_it, struct face, struct glyph_string. * src/fontset.c: Don’t include buffer.h, ccl.h, keyboard.h, intervals.h, window.h, termhooks.h. * src/frame.c: Don’t include character.h, commands.h, font.h. * src/frame.h: Don’t include dispextern.h. * src/fringe.c: Don’t include character.h. * src/ftcrfont.c: Don’t include dispextern.h, frame.h, character.h, charset.h, fontset.h. * src/ftfont.c: Don’t include frame.h, blockinput.h, coding.h, fontset.h. * src/ftxfont.c: Don’t include dispextern.h, character.h, charset.h, fontset.h. * src/gfilenotify.c: Don’t include frame.h, process.h. * src/gtkutil.c: Include dispextern.h, frame.h, systime.h. Don’t include syssignal.h, buffer.h, charset.h, font.h. * src/gtkutil.h: Don’t include frame.h. * src/image.c: Include fcntl.h and stdio.h instead of sysstdio.h. Don’t include character.h. * src/indent.c: Don’t include keyboard.h, termchar.h. * src/inotify.c: Don’t include character.h, frame.h. * src/insdel.c: Include composite.h. Don’t include blockinput.h. * src/intervals.c: Don’t include character.h, keyboard.h. * src/intervals.h: Don’t include dispextern.h, composite.h. * src/keyboard.c: Don’t include sysstdio.h, disptab.h, puresize.h. Include coding.h. * src/keyboard.h: Don’t incldue systime.h. * src/keymap.c: Don’t include charset.h, frame.h. * src/lread.c: Include dispextern.h and systime.h. Don’t include frame.h. Include systime.h. * src/macros.c: Don’t include commands.h, character.h, buffer.h. * src/menu.c: Include character.h, coding.h. Don’t include dispextern.h. * src/menu.h: Don’t include systime.h. * src/minibuf.c: Don’t include commands.h, dispextern.h, syntax.h, intervals.h, termhooks.h. * src/print.c: Include coding.h. Don’t include keyboard.h, window.h, dispextern.h, termchar.h, termhooks.h, font.h. Add forward decl of struct terminal. * src/process.c: Don’t include termhooks.h, commands.h, dispextern.h, composite.h. * src/region-cache.c: Don’t include character.h. * src/scroll.c: Don’t include keyboard.h, window.h. * src/search.c: Don’t include category.h, commands.h. * src/sound.c: Don’t include dispextern.h. * src/syntax.c: Don’t include command.h, keymap.h. * src/sysdep.c: Don’t include window.h, dispextern.h. * src/systime.h: Use ‘#ifdef emacs’, not ‘#ifdef EMACS_LISP_H’, * src/term.c: Don’t include systty.h, intervals.h, xterm.h. * src/terminal.c: Include character.h. Don’t include charset.h, coding.h. * src/textprop.c: Don’t include character.h. * src/undo.c: Don’t include character.h, commands.h, window.h. * src/unexsol.c: Don’t include character.h, charset.h. * src/widget.c: Include widget.h. Don’t include keyboard.h, window.h, dispextern.h, blockinput.h, character.h, font.h. * src/widgetprv.h: Don’t include widget.h. * src/window.c: Don’t include character.h, menu.h, intervals.h. * src/xdisp.c: Include composite.h, systime.h. Don’t include macros.h, process.h. * src/xfaces.c: Don’t include charset.h, keyboard.h, termhooks.h, intervals.h. * src/xfns.c: Don’t include menu.h, character.h, intervals.h, epaths.h, fontset.h, systime.h, atimer.h, termchar.h. * src/xfont.c: Don’t include dispextern.h, fontset.h, ccl.h. * src/xftfont.c: Don’t include dispextern.h, character.h, fontset.h. * src/xgselect.c: Don’t include timespec.h, frame.h. Include systime.h. * src/xgselect.h: Don’t include time.h. Use a forward decl to struct timespec instead. * src/xmenu.c: Don’t include keymap.h, character.h, charset.h, dispextern.h. Include systime.h. * src/xml.c: Don’t include character.h. * src/xrdb.c [USE_MOTIF]: Don’t include keyboard.h. * src/xselect.c: Don’t include dispextern.h, character.h, buffer.h, process.h. * src/xsmfns.c: Don’t include systime.h, sysselect.h. * src/xterm.c: Don’t include syssignal.h, charset.h, disptab.h, intervals.h process.h, keymap.h, xgselect.h. Include composite.h.
* Allow setting frame pixel sizes from frame parameters (Bug#21415)Martin Rudalics2015-10-131-1/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Also fix some misfeatures in frame (re-)sizing code, add more debugging information and remove some dead code. * lisp/frame.el (frame-notice-user-settings, make-frame): Change parameter names when setting `frame-size-history'. (frame--size-history): New function. * src/frame.c (frame_inhibit_resize): If frame has not been made yet, return t if inhibit_horizontal_resize or inhibit_vertical_resize bit have been set. (adjust_frame_size): Simplify. (make_frame): Initialize inhibit_horizontal_resize, inhibit_vertical_resize, tool_bar_redisplayed, tool_bar_resized. (Fframe_after_make_frame): Reset inhibit_horizontal_resize and inhibit_vertical_resize slots. (x_set_frame_parameters): Handle `text-pixels' specification for width and height parameters. Don't consider new_height or new_width changes. Call adjust_frame_size instead of Fset_frame_size. (x_figure_window_size): Two new arguments x_width and y_width returning frame's figures width and height. Calculate tool bar height before frame sizes so SET_FRAME_HEIGHT can pick it up. Handle `text-pixels' specification for width and height parameters. (Qtext_pixels, Qx_set_frame_parameters, Qset_frame_size) (Qx_set_window_size_1, Qx_set_window_size_2) (Qx_set_window_size_3, Qx_set_menu_bar_lines) (Qupdate_frame_menubar, Qfree_frame_menubar_1) (Qfree_frame_menubar_2): New symbols. * src/frame.h (structure frame): New booleans tool_bar_redisplayed, tool_bar_resized, inhibit_horizontal_resize, inhibit_vertical_resize. (x_figure_window_size): Update external declaration. * src/gtkutil.c (xg_frame_set_char_size): Set size hints before calling gtk_window_resize. (update_frame_tool_bar): Make inhibiting of frame resizing more discriminative. Set tool_bar_resized bit. * src/nsfns.m (x_set_tool_bar_lines): Make inhibiting of frame resizing more discriminative. Call adjust_frame_size instead of x_set_window_size. (Fx_create_frame): Handle x_width and x_height if set by x_figure_window_size. * src/nsterm.m (x_set_window_size): For GNUSTEP build don't subtract 3 from tool bar height. (x_set_window_size): Add frame_size_history_add call. (x_new_font): Call adjust_frame_size instead of x_set_window_size. * src/w32fns.c (x_change_tool_bar_height): Reset tool_bar_redisplayed and tool_bar_resized bits when adding tool bar. Make inhibiting of frame resizing more discriminative. (w32_wnd_proc): Remove dead code in WM_WINDOWPOSCHANGING case. (Fx_create_frame): Handle x_width and x_height if set by x_figure_window_size. Set size hints before adjusting frame size. (x_create_tip_frame): Adjust x_figure_window_size call. * src/w32term.c (x_set_window_size): Add frame_size_history_add call. * src/widget.c (set_frame_size): Remove dead code. Add frame_size_history_add call. When frame_resize_pixelwise is t use FRAME_PIXEL_WIDTH and FRAME_PIXEL_HEIGHT instead of pixel_width and pixel_height. (update_various_frame_slots): Remove dead code. (EmacsFrameResize): Add more information in frame_size_history_add call. (EmacsFrameQueryGeometry): Round only when frame_resize_pixelwise is not set. * src/xdisp.c (redisplay_tool_bar): Set tool_bar_redisplayed bits. * src/xfns.c (x_set_menu_bar_lines): Change argument name. (x_change_tool_bar_height): Reset tool_bar_redisplayed and tool_bar_resized bits when adding tool bar. Make inhibiting of frame resizing more discriminative. (Fx_create_frame): Handle x_width and x_height if set by x_figure_window_size. Set size hints before adjusting frame size. (x_create_tip_frame): Adjust x_figure_window_size call. * src/xmenu.c (update_frame_menubar): Don't handle Lucid specially. (set_frame_menubar): On Lucid never add core-border-width to avoid that adding XtNinternalBorderWidth adds it again. (free_frame_menubar): Handle frame_inhibit_resize true for Motif. * src/xterm.c (x_new_font): In non-toolkit case handle size change of menu bar. (x_set_window_size_1): Fix calls to frame_size_history_add. (x_wm_set_size_hint): Remove dead code. Set size_hints.min_width and size_hints.min_height to base_width and base_height.
* Make face realization be more frame-specificEli Zaretskii2015-09-261-0/+3
| | | | | | | | | | | | | | | | | | | | | | * src/frame.h (struct f): New flag face_change. * src/xfaces.c (Finternal_make_lisp_face) (Finternal_copy_lisp_face, Finternal_set_lisp_face_attribute) (update_face_from_frame_parameter): Set the face_change flag only for the frame whose faces are affected. * src/xdisp.c (init_iterator): If a frame's face_change flag is set, free faces only on that frame. (redisplay_internal): Disable "display optimization 1" if the frame's face_change flag is set. (redisplay_window): Don't allow skipping a window's redisplay if its frame's face_change flag is set. * src/frame.c (x_set_screen_gamma): Instead of calling Fclear_face_cache, call clear_face_cache and set windows_or_buffers_changed to a non-zero value. This avoids setting the global face_change flag that triggers face realization on all frames and thorough redisplay of all of them. * lisp/term/tty-colors.el (tty-register-default-colors): Don't clear face cache if the selected frame is a GUI frame.
* Remove tool_bar_redisplayed_once and associated code.Martin Rudalics2015-09-161-4/+0
| | | | | | | | | | | * src/frame.h (tool_bar_redisplayed_once): Remove slot. * src/frame.c (make_frame, x_set_font): Remove initialization of f->tool_bar_redisplayed_once. * src/w32fns.c (x_change_tool_bar_height): * src/xfns.c (x_change_tool_bar_height): Don't check for f->tool_bar_redisplayed_once. * src/xdisp.c (redisplay_internal): Remove handling of f->tool_bar_redisplayed_once.
* Prefer NUMBERP to spelling it outPaul Eggert2015-09-101-1/+1
| | | | | | | | | | | | | * src/editfns.c (styled_format): * src/frame.h (NUMVAL): * src/image.c (parse_image_spec): * src/lisp.h (CHECK_NUMBER_OR_FLOAT) (CHECK_NUMBER_OR_FLOAT_COERCE_MARKER): * src/process.c (Fsignal_process): * src/xdisp.c (calc_pixel_width_or_height, on_hot_spot_p): * src/xfaces.c (check_lface_attrs): * src/xselect.c (x_fill_property_data, x_send_client_event): Use NUMBERP rather than INTEGERP || FLOATP.
* Pacify --enable-gcc-warningsPaul Eggert2015-05-231-1/+0
| | | | | | | | | | | | | | | | | | | | | | * src/frame.h (x_query_color): Remove redundant extern decl. * src/ftcrfont.c (ftcrfont_glyph_extents, ftcrfont_list) (ftcrfont_match, ftcrfont_open, ftcrfont_close) (ftcrfont_text_extents, ftcrfont_draw): * src/xterm.c (x_set_window_size_1, *x_color_cells, x_update_end) (XTframe_up_to_date, x_clear_area1, x_clear_frame) (x_ins_del_lines, frame_highlight, frame_unhighlight) (x_new_focus_frame, x_focus_changed, XTframe_rehighlight) (x_draw_hollow_cursor, x_draw_bar_cursor, x_flush, x_update_begin) (x_update_window_begin, x_connection_closed) (x_set_clip_rectangles, x_reset_clip_rectangles, x_fill_rectangle) (x_draw_rectangle, x_fill_trapezoid_for_relief, x_clear_window) (*x_gc_get_ext_data, x_extension_initialize) (x_cr_accumulate_data): Remove redundant static decl. Many of these GCC doesn't complain about, but we might as well clean out the duplication while we're in the neighborhood. * src/xterm.c (x_fill_trapezoid_for_relief): Remove decl of nonexistent function.
* Merge from origin/emacs-24Paul Eggert2015-03-181-1/+1
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 1a941d6 Fix incorrect usage of @key in the User Manual (Bug#20135) 14c47d3 doc/misc/efaq-w32.texi: Spell-check. ac85901 doc/misc/efaq-w32.texi: Remove outdated information and update. c43762d Fix description of fullscreen mode on MS-Windows (Bug#20110). ea8cab3 doc/lispref/minibuf.texi (Basic Completion): Fix a typo. (Bug#20108) 2fdec80 Improve indexing in Emacs manual (Bug#20105) cc11321 Fix --no-bitmap-icon Conflicts: doc/emacs/ChangeLog doc/lispref/ChangeLog doc/misc/ChangeLog src/ChangeLog
| * Fix --no-bitmap-iconGlenn Morris2015-03-121-1/+1
| | | | | | | | | | | | | | * src/frame.h (x_set_bitmap_icon): Don't set the icon if icon-type is nil/not present in the parameter alist. Fixes: debbugs:19680
| * Update copyright year to 2015Paul Eggert2015-01-011-1/+1
| | | | | | | | Run admin/update-copyright.
* | Redo the whole window offsets and coordinate translation for X.Jan D2015-02-251-4/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * frame.h (struct frame): Remove x_pixels_diff, y_pixels_diff. * w32fns.c (x_real_positions): Remove setting of x_pixels_diff, y_pixels_diff. * xfns.c (x_real_pos_and_offsets): New function, basically the code from x_real_positions. (x_real_positions): Call x_real_pos_and_offsets. (x_relative_mouse_position): Use XTranslateCoordinates instead of OUTER_TO_INNER_DIFF macros. (Fx_frame_geometry): Get offsets with x_real_pos_and_offsets, border from window attributes. Adjust tool bar and menu widths. * xmenu.c (create_and_show_popup_menu): Use XTranslateCoordinates instead of OUTER_TO_INNER_DIFF macros. * xterm.h (struct x_output): Remove x_pixels_outer_diff, y_pixels_outer_diff, FRAME_OUTER_TO_INNER_DIFF_X, FRAME_OUTER_TO_INNER_DIFF_Y. Declare x_real_pos_and_offsets.
* | Try to improve handling of fullwidth/-height frames.Martin Rudalics2015-02-071-6/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * frame.el (frame-notice-user-settings): Update `frame-size-history'. (make-frame): Update `frame-size-history'. Call `frame-after-make-frame'. * faces.el (face-set-after-frame-default): Remove call to frame-can-run-window-configuration-change-hook. * frame.c (frame_size_history_add): New function. (frame_inhibit_resize): Consider frame_inhibit_implied_resize only after frame's after_make_frame slot is true. Inhibit resizing fullwidth-/height frames in one direction only. Update frame_size_history. (adjust_frame_size): Call frame_size_history_add. (make_frame): Initalize after_make_frame slot. (Fmake_terminal_frame): Adjust adjust_frame_size call. (Fcan_run_window_configuration_change_hook): Rename to Fframe_after_make_frame. Set after_make_frame slot. Return second argument. (x_set_frame_parameters): Postpone handling fullscreen parameter until after width and height parameters have been set. Apply width and height changes only if can_x_set_window_size is true. Update frame_size_history. (Qadjust_frame_size_1, Qadjust_frame_size_2) (Qadjust_frame_size_3, QEmacsFrameResize, Qframe_inhibit_resize) (Qx_set_fullscreen, Qx_check_fullscreen, Qx_set_window_size_1) (Qxg_frame_resized, Qxg_frame_set_char_size_1) (Qxg_frame_set_char_size_2, Qxg_frame_set_char_size_3) (Qxg_change_toolbar_position, Qx_net_wm_state) (Qx_handle_net_wm_state, Qtb_size_cb, Qupdate_frame_tool_bar) (Qfree_frame_tool_bar): New symbol for updating frame_size_history. (Qtip_frame, Qterminal_frame): New symbols. (Vframe_adjust_size_history): Rename to frame_size_history. * frame.h (struct frame): Rename can_run_window_configuration_change_hook slot to after_make_frame. (frame_size_history_add): Extern. * gtkutil.c (xg_frame_resized): Call frame_size_history_add. Don't set FRAME_PIXEL_WIDTH and FRAME_PIXEL_HEIGHT here. (xg_frame_set_char_size): Try to preserve the status of fullwidth/-height frames. Call frame_size_history_add. (tb_size_cb, update_frame_tool_bar, free_frame_tool_bar) (xg_change_toolbar_position): Call frame_size_history_add. * w32fns.c (x_change_tool_bar_height): Handle frame's fullscreen status. (Fx_create_frame): Process fullscreen parameter after frame has been resized. (x_create_tip_frame): Pass Qtip_frame to adjust_frame_size. (Fx_frame_geometry): Don't pollute pure storage. * w32term.c (w32_read_socket): For WM_WINDOWPOSCHANGED, WM_ACTIVATE and WM_ACTIVATEAPP set frame's visibility before calling w32fullscreen_hook. For WM_DISPLAYCHANGE call w32fullscreen_hook immediately. (x_fullscreen_adjust, x_check_fullscreen): Remove. (w32fullscreen_hook): Call change_frame_size just as with a "normal" frame resize operation. Call do_pending_window_change. (x_set_window_size): Try to handle fullwidth and fullheight more accurately. Don't rely on w32_enable_frame_resize_hack. (w32_enable_frame_resize_hack): Remove variable. * widget.c (EmacsFrameResize): Remove dead code. Call frame_size_history_add * window.c (run_window_configuration_change_hook): Check f->after_make_frame instead of f->can_run_window_configuration_change_hook. * xfns.c (x_change_tool_bar_height): Handle frame's fullscreen status. (Fx_create_frame): Process fullscreen parameter after frame has been resized. (Fx_frame_geometry): Don't pollute pure storage. * xterm.c (x_net_wm_state, x_handle_net_wm_state): Call frame_size_history_add. (do_ewmh_fullscreen): Handle x_frame_normalize_before_maximize. (x_check_fullscreen): Count in menubar when calling XResizeWindow. Wait for ConfigureNotify event. Call frame_size_history_add. (x_set_window_size_1): Remove PIXELWISE argument. Try to handle changing a fullheight frame's width or a fullwidth frame's height. Call frame_size_history_add. (x_set_window_size): Simplify xg_frame_set_char_size and x_set_window_size_1 calls. (x_frame_normalize_before_maximize): New variable.
* | Omit unnecessary var if GTK or NSPaul Eggert2015-02-021-0/+2
| | | | | | | | | | * frame.c, frame.h (frame_default_tool_bar_height) [USE_GTK||HAVE_NS]: Now a constant zero on these platforms.
* | Adjust frame heights to real height of tool bar.Martin Rudalics2015-01-121-0/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * frame.el (frame-notice-user-settings): Remove code dealing with frame-initial-frame-tool-bar-height. Turn off `tool-bar-mode' only if `window-system-frame-alist' or `default-frame-alist' ask for it. (make-frame): Update frame-adjust-size-history if needed. * dispnew.c (change_frame_size_1): Pass Qchange_frame_size to adjust_frame_size. * frame.c (frame_default_tool_bar_height): New variable. (adjust_frame_size): Possibly add requested adjustment to Vframe_adjust_size_history. (make_frame): Initialize tool_bar_redisplayed_once slot. (Fset_frame_height, Fset_frame_width, Fset_frame_size): Clarify doc-string. Call adjust_frame_size unconditionally (the frame's text size may remain unaltered but the pixel size may change). (x_figure_window_size): If frame_default_tool_bar_height was set, use it instead of calculating the tool bar height from DEFAULT_TOOL_BAR_IMAGE_HEIGHT. Don't set Vframe_initial_frame_tool_bar_height. (Qchange_frame_size, Qxg_frame_set_char_size) (Qset_window_configuration, Qx_create_frame_1) (Qx_create_frame_2): New symbols. (Vframe_initial_frame_tool_bar_height): Remove. (Vframe_adjust_size_history): New history variable for debugging frame size adjustments. * frame.h (struct frame): New boolean slot tool_bar_redisplayed_once. (frame_default_tool_bar_height): Extern. * gtkutil.c (xg_frame_set_char_size): Pass Qxg_frame_set_char_size to adjust_frame_size. * nsfns.m (Fx_create_frame): Pass Pass Qx_create_frame_1 and Qx_create_frame_2 to adjust_frame_size. * w32fns.c (x_change_tool_bar_height): Call adjust_frame_size with inhibit 1 when we have not redisplayed the tool bar yet. (Fx_create_frame): Pass Pass Qx_create_frame_1 and Qx_create_frame_2 to adjust_frame_size. * w32menu.c (set_frame_menubar): Simplify adjust_frame_size call. * window.c (Fset_window_configuration): Pass Qset_window_configuration to adjust_frame_size. * xdisp.c (redisplay_tool_bar): Assign new height to frame_default_tool_bar_height. (redisplay_internal): If we haven't redisplayed this frame's tool bar, call redisplay_tool_bar early so we can adjust the frame size accordingly. * xfns.c (x_change_tool_bar_height): Call adjust_frame_size with inhibit 1 when we have not redisplayed the tool bar yet. (Fx_create_frame): Pass Pass Qx_create_frame_1 and Qx_create_frame_2 to adjust_frame_size.
* | Compute C decls for DEFSYMs automaticallyPaul Eggert2015-01-051-51/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Fixes Bug#15880. This patch also makes Q constants (e.g., Qnil) constant addresses from the C point of view. * make-docfile.c: Revamp to generate table of symbols, too. Include <stdbool.h>. (xstrdup): New function. (main): Don't process the same file twice. (SYMBOL): New constant in enum global_type. (struct symbol): Turn 'value' member into a union, either v.value for int or v.svalue for string. All uses changed. (add_global): New arg svalue, which overrides value, so that globals can have a string value. (close_emacs_global): New arg num_symbols; all uses changed. Output lispsym decl. (write_globals): Output symbol globals too. Output more ATTRIBUTE_CONST, now that Qnil etc. are C constants. Output defsym_name table. (scan_c_file): Move most of guts into ... (scan_c_stream): ... new function. Scan for DEFSYMs and record symbols found. Don't read past EOF if file doesn't end in newline. * alloc.c, bidi.c, buffer.c, bytecode.c, callint.c, casefiddle: * casetab.c, category.c, ccl.c, charset.c, chartab.c, cmds.c, coding.c: * composite.c, data.c, dbusbind.c, decompress.c, dired.c, dispnew.c: * doc.c, editfns.c, emacs.c, eval.c, fileio.c, fns.c, font.c, fontset.c: * frame.c, fringe.c, ftfont.c, ftxfont.c, gfilenotify.c, gnutls.c: * image.c, inotify.c, insdel.c, keyboard.c, keymap.c, lread.c: * macfont.m, macros.c, minibuf.c, nsfns.m, nsfont.m, nsimage.m: * nsmenu.m, nsselect.m, nsterm.m, print.c, process.c, profiler.c: * search.c, sound.c, syntax.c, term.c, terminal.c, textprop.c, undo.c: * window.c, xdisp.c, xfaces.c, xfns.c, xftfont.c, xmenu.c, xml.c: * xselect.c, xsettings.c, xterm.c: Remove Q vars that represent symbols (e.g., Qnil, Qt, Qemacs). These names are now defined automatically by make-docfile. * alloc.c (init_symbol): New function. (Fmake_symbol): Use it. (c_symbol_p): New function. (valid_lisp_object_p, purecopy): Use it. * alloc.c (marked_pinned_symbols): Use make_lisp_symbol instead of make_lisp_ptr. (garbage_collect_1): Mark lispsym symbols. (CHECK_ALLOCATED_AND_LIVE_SYMBOL): New macro. (mark_object): Use it. (sweep_symbols): Sweep lispsym symbols. (symbol_uses_obj): New function. (which_symbols): Use it. Work for lispsym symbols, too. (init_alloc_once): Initialize Vpurify_flag here; no need to wait, since Qt's address is already known now. (syms_of_alloc): Add lispsym count to symbols_consed. * buffer.c (init_buffer_once): Compare to Qnil, not to make_number (0), when testing whether storage is all bits zero. * dispextern (struct image_type): * font.c (font_property_table): * frame.c (struct frame_parm_table, frame_parms): * keyboard.c (scroll_bar_parts, struct event_head): * xdisp.c (struct props): Use XSYMBOL_INIT (Qfoo) and struct Lisp_Symbol * rather than &Qfoo and Lisp_Object *, since Qfoo is no longer an object whose address can be taken. All uses changed. * eval.c (run_hook): New function. Most uses of Frun_hooks changed to use it, so that they no longer need to take the address of a Lisp sym. (syms_of_eval): Don't use DEFSYM on Vrun_hooks, as it's a variable. * frame.c (syms_of_frame): Add defsyms for the frame_parms table. * keyboard.c (syms_of_keyboard): Don't DEFSYM Qmenu_bar here. DEFSYM Qdeactivate_mark before the corresponding var. * keymap.c (syms_of_keymap): Use DEFSYM for Qmenu_bar and Qmode_line instead of interning their symbols; this avoids duplicates. (LISP_INITIALLY, TAG_PTR) (DEFINE_LISP_SYMBOL_BEGIN, DEFINE_LISP_SYMBOL_END, XSYMBOL_INIT): New macros. (LISP_INITIALLY_ZERO): Use it. (enum symbol_interned, enum symbol_redirect, struct Lisp_Symbol) (EXFUN, DEFUN_ARGS_MANY, DEFUN_ARGS_UNEVALLED, DEFUN_ARGS_*): Move decls up, to avoid forward uses. Include globals.h earlier, too. (make_lisp_symbol): New function. (XSETSYMBOL): Use it. (DEFSYM): Now just a placeholder for make-docfile. * lread.c (DEFINE_SYMBOLS): Define, for globals.h. (intern_sym): New function, with body taken from old intern_driver. (intern_driver): Use it. Last arg is now Lisp integer, not ptrdiff_t. All uses changed. (define_symbol): New function. (init_obarray): Define the C symbols taken from lispsym. Use plain DEFSYM for Qt and Qnil. * syntax.c (init_syntax_once): No need to worry about Qchar_table_extra_slots.
* | Update copyright year to 2015Paul Eggert2015-01-011-1/+1
| | | | | | | | Run admin/update-copyright.
* | Use bool for boolean in xterm.cPaul Eggert2014-12-211-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * frame.h, nsterm.m, w32term.c, w32term.h, xterm.c: (x_set_window_size, x_bitmap_icon): * nsterm.m (ns_frame_raise_lower, x_new_font): * termhooks.h (struct terminal.toggle_invisible_pointer_hook) (struct terminal.frame_raise_lower_hook): * w32term.c (w32_frame_raise_lower): * xterm.c, xterm.h (x_text_icon): * xterm.c (x_update_window_begin, x_update_window_end) (x_update_end, x_after_update_window_line) (x_set_glyph_string_gc, x_draw_glyph_string_background) (x_draw_glyph_string_foreground) (x_draw_composite_glyph_string_foreground) (x_alloc_lighter_color, x_draw_relief_rect) (x_draw_glyph_string_box, x_draw_image_relief) (x_draw_image_glyph_string, x_draw_stretch_glyph_string) (x_draw_underwave, x_draw_glyph_string, x_show_hourglass) (x_hide_hourglass): (XFillRectangle) [HAVE_GTK3]: (XTtoggle_invisible_pointer, frame_highlight, frame_unhighlight) (x_focus_changed, x_find_modifier_meanings, note_mouse_movement) (XTmouse_position, xt_action_hook, xt_horizontal_action_hook) (x_send_scroll_bar_event, xm_scroll_callback) (xg_scroll_callback, xaw_jump_callback, xaw_scroll_callback) (x_create_toolkit_scroll_bar) (x_create_horizontal_toolkit_scroll_bar) (x_set_toolkit_horizontal_scroll_bar_thumb, x_scroll_bar_create) (x_scroll_bar_set_handle, XTset_vertical_scroll_bar) (XTset_horizontal_scroll_bar, x_scroll_bar_expose) (x_scroll_bar_handle_click, x_scroll_bar_note_movement) (x_scroll_bar_report_motion) (x_horizontal_scroll_bar_report_motion, x_net_wm_state) (handle_one_xevent, XTread_socket, x_draw_bar_cursor) (x_draw_window_cursor, x_clear_errors) (x_trace_wire, x_new_font, x_set_offset, wm_supports) (set_wm_state, x_set_sticky, get_current_wm_state) (do_ewmh_fullscreen, x_handle_net_wm_state) (x_check_expected_move, x_sync_with_move, x_wait_for_event) (x_set_window_size_1, XTframe_raise_lower) (x_make_frame_visible, x_iconify_frame) (x_timeout_atimer_activated_flag, same_x_server, x_display_ok) (x_term_init, x_process_timeouts, x_activate_timeout_atimer) (x_delete_terminal, x_initialize, syms_of_xterm): Use bool for boolean.
* | Run `window-configuration-change-hook' only after all faces have been realized.Martin Rudalics2014-11-081-5/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * frame.c (adjust_frame_size): Call x_set_window_size only if f->can_x_set_window_size is set. (make_frame): Initialize f->can_x_set_window_size and f->can_run_window_configuration_change_hook. (Fcan_run_window_configuration_change_hook): New function. * frame.h (frame): Split `official' into `can_x_set_window_size' and `can_run_window_configuration_change_hook'. * nsfns.m (Fx_create_frame): Set f->can_x_set_window_size. * w32fns.c (Fx_create_frame, x_create_tip_frame): Set f->can_x_set_window_size. * window.c (run_window_configuration_change_hook): Return immediately if either f->can_x_set_window_size or f->can_run_window_configuration_change_hook are false. (Fset_window_configuration): Instead of f->official set f->can_x_set_window_size. * xfns.c (Fx_create_frame, x_create_tip_frame): Set f->can_x_set_window_size. * faces.el (face-set-after-frame-default): Enable running `window-configuration-change-hook'.
* | Improve inhibiting of implied frame resizes.Martin Rudalics2014-11-071-2/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * frames.texi (Size and Position): Rewrite description of `frame-inhibit-implied-resize'. * cus-start.el (frame-resize-pixelwise): Fix group. (frame-inhibit-implied-resize): Add entry. * dispnew.c (change_frame_size_1): Fix call of adjust_frame_size. * frame.c (Qsize, Qframe_position, Qframe_outer_size) (Qframe_inner_size, Qexternal_border_size, Qtitle_height) (Qmenu_bar_external, Qmenu_bar_size, Qtool_bar_external) (Qtool_bar_size): New constants. (frame_inhibit_resize, adjust_frame_size): New argument to handle case where frame_inhibit_implied_resize is a list. (Fmake_terminal_frame, Fset_frame_height, Fset_frame_width) (Fset_frame_size, x_set_left_fringe, x_set_right_fringe) (x_set_right_divider_width, x_set_bottom_divider_width) (x_set_vertical_scroll_bars, x_set_horizontal_scroll_bars) (x_set_scroll_bar_width, x_set_scroll_bar_height): Update callers. (frame-inhibit-implied-resize): Rewrite doc-string. * frame.h (frame_inhibit_resize, adjust_frame_size): Fix external declarations. (Qframe_position, Qframe_outer_size) (Qframe_inner_size, Qexternal_border_size, Qtitle_height) (Qmenu_bar_external, Qmenu_bar_size, Qtool_bar_external) (Qtool_bar_size): Extern them. * gtkutil.c (FRAME_TOTAL_PIXEL_HEIGHT, FRAME_TOTAL_PIXEL_WIDTH) (xg_height_or_width_changed): Remove. (xg_frame_set_char_size): Adjust adjust_frame_size calls. (menubar_map_cb, xg_update_frame_menubar, free_frame_menubar) (tb_size_cb, update_frame_tool_bar, free_frame_tool_bar) (xg_change_toolbar_position): Call adjust_frame_size directly. * nsfns.m (x_set_internal_border_width, Fx_create_frame): Fix calls of adjust_frame_size. * w32fns.c (x_set_internal_border_width, x_set_menu_bar_lines) (Fx_create_frame, x_create_tip_frame): Adjust adjust_frame_size calls. (x_set_tool_bar_lines, x_change_tool_bar_height): Make sure that frame can get resized when tool-bar-lines parameter changes from or to zero. (Fw32_frame_menu_bar_size): Return fourth value. (Fw32_frame_rect): Block input around system calls (Fx_frame_geometry): New function. * w32menu.c (set_frame_menubar): Adjust adjust_frame_size call. * w32term.c (x_new_font): Adjust adjust_frame_size call. * widget.c (EmacsFrameSetCharSize): Adjust frame_inhibit_resize call. * window.c (Fset_window_configuration): Adjust adjust_frame_size call. * xfns.c (x_set_menu_bar_lines, x_set_internal_border_width) (Fx_create_frame): Adjust adjust_frame_size calls. (x_set_tool_bar_lines, x_change_tool_bar_height): Make sure that frame can get resized when tool-bar-lines parameter changes from or to zero. (Fx_frame_geometry): New function. * xmenu.c (update_frame_menubar): On Lucid call adjust_frame_size with one pixel less height to avoid that repeatedly adding/removing the menu bar grows the frame. (free_frame_menubar): On Motif arrange to optionally preserve the old frame height when removing the menu bar. * xterm.c (x_new_font): Adjust adjust_frame_size call.
* | Use AUTO_CONS instead of SCOPED_CONS, etc.Paul Eggert2014-09-301-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * doc/lispref/internals.texi (Stack-allocated Objects): Adjust to match the revised, less error-prone macros. * src/frame.h (AUTO_FRAME_ARG): Rename from FRAME_PARAMETER. * src/lisp.h (AUTO_CONS): Rename from scoped_cons. (AUTO_LIST1): Rename from scoped_list1. (AUTO_LIST2): Rename from scoped_list2. (AUTO_LIST3): Rename from scoped_list3. (AUTO_LIST4): Rename from scoped_list4. (AUTO_STRING): Rename from SCOPED_STRING. * src/frame.h (AUTO_FRAME_ARG): * src/lisp.h (AUTO_CONS, AUTO_LIST1, AUTO_LIST2, AUTO_LIST3) (AUTO_LIST4, AUTO_STRING): Prepend a new argument 'name'. Declare a variable instead of yielding a value. All uses changed. * src/lisp.h (STACK_CONS, AUTO_CONS_EXPR): New internal macros.
* | Minor improvements to new stack-allocated Lisp objects.Paul Eggert2014-09-211-1/+1
| | | | | | | | | | | | | | | | | | | | | | * frame.h (FRAME_PARAMETER): Prefer scoped_list1 to local_list1 where either would do. * lisp.h (scoped_list4): New macro. (local_cons, local_list1, local_list2, local_list3, local_list4) (make_local_vector, make_local_string, build_local_string): Prefer functions to macros where either would do. * xdisp.c (build_desired_tool_bar_string): Prefer scoped_list4 to local_list4 where either would do.
* | More and more stack-allocated Lisp objects if USE_LOCAL_ALLOCATORS.Dmitry Antipov2014-09-181-0/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * lisp.h (local_list4) [USE_LOCAL_ALLOCATORS]: New macro. [!USE_LOCAL_ALLOCATORS]: Fall back to regular list4. * frame.h (FRAME_PARAMETER): New macro. * dispnew.c (init_display): * fontset.c (Fset_fontset_font): * frame.c (x_default_parameter): * xfaces.c (set_font_frame_param, Finternal_merge_in_global_face): * xfns.c (x_default_scroll_bar_color_parameter) (x_default_font_parameter, x_create_tip_frame): Use it. * editfns.c (Fpropertize): Use local_cons. * process.c (status_message): Use build_local_string. * xfont.c (xfont_open): Use make_local_string. * xdisp.c (build_desired_tool_bar_string): Use local_list4.
* | Spelling fixes.Paul Eggert2014-09-111-1/+1
| | | | | | | | | | | | | | * lisp/ses.el (ses-file-format-extend-parameter-list): Rename from ses-file-format-extend-paramter-list. All uses changed. * lisp/gnus-cloud.el (gnus-cloud-parse-version-1): Fix misspelling of ":delete".
* | Pacify --enable-gcc-warnings when no window system is used.Paul Eggert2014-09-101-3/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | These warnings found that subscript error, so they seem worthwhile. * composite.c (char_composable_p): Simplify a bit. * frame.c (x_set_frame_parameters): Add an IF_LINT. * frame.c (x_set_horizontal_scroll_bars, x_set_scroll_bar_height): * frame.h (FRAME_HAS_HORIZONTAL_SCROLL_BARS): * window.c (set_window_scroll_bars): Use USE_HORIZONTAL_SCROLL_BARS for simplicity. * frame.h [! USE_HORIZONTAL_SCROLL_BARS]: Ignore -Wsuggest-attribute=const. * window.h (USE_HORIZONTAL_SCROLL_BARS): New macro. (WINDOW_HAS_HORIZONTAL_SCROLL_BAR): Use it.
* | Fix scroll bar handling for non-toolkit builds.Martin Rudalics2014-08-041-3/+10
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * frame.h (FRAME_HAS_HORIZONTAL_SCROLL_BARS): Condition correctly according to toolkit used. * frame.c (make_initial_frame, make_terminal_frame) (x_set_horizontal_scroll_bars, x_set_scroll_bar_height) (Vdefault_frame_horizontal_scroll_bars): Correctly condition assignments according to presence of toolkit scrollbars. * window.h (WINDOW_HAS_HORIZONTAL_SCROLL_BAR): Condition correctly according to toolkit used. * window.c (set_window_scroll_bars): Set horizontal scroll bar only if toolkit supports it. * w32term.c (w32_redeem_scroll_bar): Always redeem scroll bar if present. * xterm.c (x_scroll_bar_create): Initialize horizontal slot for non-toolkit builds. (XTredeem_scroll_bar): Always redeem scroll bar if present.
* | Make functions static that no longer need to be extern.Paul Eggert2014-08-011-10/+6
| | | | | | | | | | | | | | | | * frame.c, frame.h (set_menu_bar_lines): * keyboard.c (Qleftmost, Qrightmost): * xfns.c, frame.h, menu.h (x_set_menu_bar_lines, x_set_tool_bar_lines) (x_set_internal_border_width): Now static.
* | Fix --without-x build and pacify --enable-gcc-warnings.Dmitry Antipov2014-07-281-4/+2
| | | | | | | | | | | | | | | | | | Problems reported in Bug#18122 and Bug#18124. * frame.c (get_frame_param): Define even if !HAVE_WINDOW_SYSTEM. (frame_windows_min_size): Now static. * frame.h (FRAME_HAS_HORIZONTAL_SCROLL_BARS) [!HAVE_WINDOW_SYSTEM]: Define as no-op. (adjust_frame_size): Always declare prototype.
* | Complete pixelwise frame/window resizing, add horizontal scrollbar support.Martin Rudalics2014-07-271-112/+176
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * frame.el (frame-notice-user-settings): Rewrite using frame-initial-frame-tool-bar-height. * menu-bar.el (menu-bar-horizontal-scroll-bar) (menu-bar-no-horizontal-scroll-bar): New functions. (menu-bar-showhide-scroll-bar-menu): Add bindings for horizontal scroll bars. * scroll-bar.el (scroll-bar-lines) (set-horizontal-scroll-bar-mode) (get-horizontal-scroll-bar-mode, horizontal-scroll-bar-mode) (scroll-bar-horizontal-drag-1, scroll-bar-horizontal-drag) (scroll-bar-toolkit-horizontal-scroll): New functions. (horizontal-scroll-bar-mode) (previous-horizontal-scroll-bar-mode) (horizontal-scroll-bar-mode-explicit): New variables. (horizontal-scroll-bar-mode): New option. (toggle-horizontal-scroll-bar): Do something. (top-level): Bind horizontal-scroll-bar mouse-1. * startup.el (tool-bar-originally-present): Remove variable. (command-line): Don't set tool-bar-originally-present. * window.el (window-min-height): Update doc-string. (window--dump-frame): Dump horizontal scroll bar values. (window--min-size-1): Handle minibuffer window separately. Count in margins and horizontal scroll bar. Return safe value iff IGNORE equals 'safe. (frame-windows-min-size): New function (used by frame resizing routines). (fit-frame-to-buffer, fit-window-to-buffer): Count in horizontal scroll bars. (window--sanitize-window-sizes): New function. (window-split-min-size): Remove. (split-window): Count divider-width. Don't use `window-split-min-size' any more. Reword error messages. Sanitize windows sizes after splitting. * buffer.h (struct buffer): New fields scroll_bar_height and horizontal_scroll_bar_type. * buffer.c (bset_scroll_bar_height) (bset_horizontal_scroll_bar_type): New functions. (Fbuffer_swap_text): Handle old_pointm field. (init_buffer_once): Set defaults for scroll_bar_height and horizontal_scroll_bar_type. (syms_of_buffer): New variables scroll_bar_height and horizontal_scroll_bar_type. * dispextern.h (window_part): Rename ON_SCROLL_BAR to ON_VERTICAL_SCROLL_BAR. Add ON_HORIZONTAL_SCROLL_BAR. (set_vertical_scroll_bar): Remove prototype. (x_change_tool_bar_height): Add prototype. * dispnew.c (adjust_frame_glyphs_for_frame_redisplay) (window_to_frame_vpos, update_frame_1, scrolling, init_display): Use FRAME_TOTAL_COLS and FRAME_TOTAL_LINES instead of FRAME_COLS and FRAME_LINES. (adjust_frame_glyphs_for_window_redisplay): Rearrange lines. (update_window): Start mode_line_row->y after horizontal scroll bar. (change_frame_size_1): Call adjust_frame_size. (init_display): When changing the size of a tty frame do not pass height of menu bar. (Qframe_windows_min_size): New symbol. * frame.h (struct frame): List tool bar fields after menu bar fields. Add official, total_lines, horizontal_scroll_bars, config_scroll_bar_height and config_scroll_bar_lines fields. (FRAME_HAS_HORIZONTAL_SCROLL_BARS) (FRAME_CONFIG_SCROLL_BAR_HEIGHT, FRAME_CONFIG_SCROLL_BAR_LINES) (FRAME_SCROLL_BAR_AREA_HEIGHT, FRAME_SCROLL_BAR_COLS) (FRAME_SCROLL_BAR_LINES, FRAME_TOTAL_LINES, SET_FRAME_LINES) (FRAME_WINDOWS_HEIGHT): New macros. (SET_FRAME_HEIGHT, FRAME_TEXT_LINES_TO_PIXEL_HEIGHT) (FRAME_PIXEL_Y_TO_LINE, FRAME_PIXEL_HEIGHT_TO_TEXT_LINES) (FRAME_TEXT_TO_PIXEL_HEIGHT): Separately count top margin and horizontal scroll bar. (frame_inhibit_resize, adjust_frame_size) (frame_windows_min_size): Add declarations. (Qscroll_bar_height, Qhorizontal_scroll_bars) (x_set_scroll_bar_default_height, x_set_left_fringe) (x_set_right_fringe, x_set_vertical_scroll_bars) (x_set_horizontal_scroll_bars, x_set_scroll_bar_width) (x_set_scroll_bar_height): Add external declarations. * frame.c: (frame_inhibit_resize, frame_windows_min_size) (adjust_frame_size): New functions. (make_frame): Initial horizontal_scroll_bars field. Use SET_FRAME_LINES. Don't allow horizontal scroll bar in minibuffer window. (make_initial_frame, make_terminal_frame): No horizontal scroll bar in initial and terminal frames. Use adjust_frame_size. (Fframe_total_cols): Fix doc-string. (Fframe_total_lines, Fscroll_bar_height): New Lisp functions. (Fset_frame_height, Fset_frame_width, Fset_frame_size): Rewrite using adjust_frame_size. (Qscroll_bar_height, Qhorizontal_scroll_bars) (Qframe_windows_min_size): New symbols. (x_set_frame_parameters): Remove call of check_frame_size. (x_report_frame_params): Return scroll_bar_height value. (x_set_left_fringe, x_set_right_fringe): New functions. (adjust_frame_height, x_set_internal_border_width) (x_set_fringe_width): Remove. (x_set_internal_border_width, x_set_vertical_scroll_bars) (x_set_scroll_bar_width, x_set_right_divider_width) (x_set_bottom_divider_width): Rewrite using adjust_frame_size. (x_set_horizontal_scroll_bars, x_set_scroll_bar_height): New functions. (x_figure_window_size): Rewrite to make frame display the expected number of lines. (Vdefault_frame_scroll_bars): Rewrite doc-string. (Vdefault_frame_horizontal_scroll_bars) (Vframe_initial_frame_tool_bar_height) (frame_inhibit_implied_resize): New variables. * fringe.c (compute_fringe_widths): Remove. * gtkutil.h (YG_SB_MIN, YG_SB_MAX, YG_SB_RANGE): Define. (xg_create_horizontal_scroll_bar) (xg_update_horizontal_scrollbar_pos) (xg_set_toolkit_horizontal_scroll_bar_thumb) (xg_get_default_scrollbar_height) (xg_clear_under_internal_border): Extern. * gtkutil.c (xg_frame_resized): Don't call do_pending_window_change. (xg_frame_set_char_size): Use adjust_frame_size. (style_changed_cb): Call update_theme_scrollbar_height and x_set_scroll_bar_default_height. (x_wm_set_size_hint): Don't call check_frame_size. (update_theme_scrollbar_height) (xg_get_default_scrollbar_height) (xg_create_horizontal_scroll_bar) (xg_update_horizontal_scrollbar_pos) (xg_set_toolkit_horizontal_scroll_bar_thumb): New functions. (xg_create_scroll_bar): Set horizontal slot of bar. (xg_initialize): Call update_theme_scrollbar_height. (xg_clear_under_internal_border): No more static. * insdel.c (adjust_suspend_auto_hscroll): New function. (adjust_markers_for_delete, adjust_markers_for_insert) (adjust_markers_for_replace): Call adjust_suspend_auto_hscroll. * keyboard.c (readable_events, discard_mouse_events) (make_lispy_event): Handle horizontal scroll bar click events. (Fsuspend_emacs): When changing the size of a tty frame do not pass height of menu bar. (Qbefore_handle, Qhorizontal_handle, Qafter_handle, Qleft) (Qright, Qleftmost, Qrightmost): New symbols. * menu.c (Fx_popup_dialog): Use FRAME_TOTAL_LINES instead of FRAME_LINES. * minibuf.c (read_minibuf): Initialize suspend_auto_hscroll. * nsfns.m (x_set_internal_border_width): New function. * nsterm.m (ns_draw_fringe_bitmap, ns_set_vertical_scroll_bar): Remove extended fringe code. (x_set_window_size, x_new_font): Don't call compute_fringe_widths. * term.c (Fresume_tty): When changing the size of a tty frame do not pass height of menu bar. (clear_tty_hooks, set_tty_hooks): Clear horizontal_scroll_bar_hook. (init_tty): Frame has no horizontal scroll bars. * termhooks.h (enum scroll_bar_part): Add scroll_bar_move_ratio, scroll_bar_before_handle, scroll_bar_horizontal_handle, scroll_bar_after_handle, scroll_bar_left_arrow, scroll_bar_right_arrow, scroll_bar_to_leftmost and scroll_bar_to_rightmost entries. (enum event_kind): Add HORIZONTAL_SCROLL_BAR_CLICK_EVENT (struct terminal): Add set_horizontal_scroll_bar_hook. * w32console.c (initialize_w32_display): Clear horizontal_scroll_bar_hook. * w32fns.c (x_set_mouse_color): Use FRAME_W32_DISPLAY instead of FRAME_X_DISPLAY. (x_clear_under_internal_border, x_set_internal_border_width): New functions. (x_set_menu_bar_lines): Rewrite using frame_inhibit_resize. Set windows_or_buffers_changed when adding the menu bar. (x_set_tool_bar_lines): Rewrite using adjust_frame_size. (x_change_tool_bar_height, x_set_scroll_bar_default_height) (w32_createhscrollbar): New functions. (w32_createscrollbar): Rename to w32_createvscrollbar. (w32_createwindow): Init WND_HSCROLLBAR_INDEX. (w32_name_of_message): Replace WM_EMACS_CREATESCROLLBAR by WM_EMACS_CREATEVSCROLLBAR and WM_EMACS_CREATEHSCROLLBAR. Add WM_EMACS_SHOWCURSOR. (w32_wnd_proc): Handle WM_HSCROLL case. In WM_WINDOWPOSCHANGING case do not artificially impose WM size hints. Handle WM_EMACS_SHOWCURSOR case. Replace WM_EMACS_CREATESCROLLBAR case by WM_EMACS_CREATEVSCROLLBAR and WM_EMACS_CREATEHSCROLLBAR cases. (my_create_tip_window): Replace WND_SCROLLBAR_INDEX by WND_VSCROLLBAR_INDEX and WND_HSCROLLBAR_INDEX. (unwind_create_frame_1): Remove. (Fx_create_frame): Make both scrollbars the system standard width and height. Use official field of frame structure to inhibit running window-configuration-change-hook. (x_create_tip_frame): Call SET_FRAME_LINES and change_frame_size pixelwise. Handle frame's official field. (w32_frame_parm_handlers): Remove x_set_fringe_width entries. Add x_set_scroll_bar_height, x_set_horizontal_scroll_bars, x_set_left_fringe and x_set_right_fringe. * w32inevt.c (resize_event, maybe_generate_resize_event): Do not pass height of menu bar to change_frame_size. * w32menu.c (set_frame_menubar): Rewrite using frame_inhibit_resize. * w32term.h (struct w32_display_info): Add horizontal_scroll_bar_cursor and cursor_display_counter. (struct scroll_bar): Add horizontal. (HORIZONTAL_SCROLL_BAR_INSIDE_HEIGHT) (HORIZONTAL_SCROLL_BAR_LEFT_RANGE) (HORIZONTAL_SCROLL_BAR_INSIDE_WIDTH) (HORIZONTAL_SCROLL_BAR_LEFT_BORDER) (HORIZONTAL_SCROLL_BAR_RIGHT_BORDER) (HORIZONTAL_SCROLL_BAR_TOP_BORDER) (HORIZONTAL_SCROLL_BAR_BOTTOM_BORDER) (HORIZONTAL_SCROLL_BAR_MIN_HANDLE): New macros. (WM_EMACS_CREATEVSCROLLBAR, WM_EMACS_CREATEHSCROLLBAR): Define instead of WM_EMACS_CREATESCROLLBAR. (WND_VSCROLLBAR_INDEX, WND_HSCROLLBAR_INDEX): Define instead of WND_SCROLLBAR_INDEX. * w32term.c (horizontal_scroll_bar_min_handle) (horizontal_scroll_bar_left_border) (horizontal_scroll_bar_right_border): New integers. (x_set_frame_alpha): Replace x_highlight_frame by w32_focus_frame. (x_window_to_scroll_bar): New argument "type". Update callers accordingly. (w32_set_horizontal_scroll_bar_thumb) (x_horizontal_scroll_bar_report_motion) (w32_set_horizontal_scroll_bar) (w32_horizontal_scroll_bar_handle_click) (x_horizontal_scroll_bar_report_motion): New functions. (w32_mouse_position): Discriminate horizontal and vertical scrollbar cases. (my_create_scrollbar): Replace with two new functions my_create_vscrollbar and my_create_hscrollbar. (x_scroll_bar_create): New argument "horizontal". Update callers accordingly. (x_scroll_bar_remove, w32_condemn_scroll_bars) (w32_redeem_scroll_bar, x_scroll_bar_clear): Handle horizontal scroll bar case. (w32_read_socket): Handle WM_HSCROLL cae. (x_new_font): Don't recompute fringe widths. Use frame_inhibit_resize. Calculate new menu bar height iff we build without toolkit. Always clear under internal border. (x_set_window_size): Don't check frame size or recompute fringes. Reset fullscreen status before applying sizes. Always resize as requested by pixelwise argument. Don't call do_pending_window_change. (x_wm_set_size_hint): Add call for FRAME_SCROLL_BAR_AREA_HEIGHT. (w32_initialize_display_info): Initialize dpyinfo's horizontal_scroll_bar_cursor entry. (w32_create_terminal): Add set_horizontal_scroll_bar_hook. (w32_initialize): Init horizontal_scroll_bar_min_handle and horizontal_scroll_bar_left_border. (w32fullscreen_hook): Intermittently resize window to normal when switching from fullscreen to maximized state. (run_window_configuration_change_hook): Don't run it if frame is not official yet. (unwind_change_frame): Remove. (Fset_window_configuration): Rewrite using frame's official field. * widget.c (set_frame_size): Don't call compute_fringe_widths. (EmacsFrameSetCharSize): Obey frame_inhibit_resize. * window.h (struct window): New fields old_pointm, horizontal_scroll_bar, horizontal_scroll_bar_type, hscroll_whole, scroll_bar_height and suspend_auto_hscroll. (wset_horizontal_scroll_bar, wset_horizontal_scroll_bar_type): New functions. (sanitize_window_sizes): Extern. (MINI_NON_ONLY_WINDOW_P, MINI_ONLY_WINDOW_P, WINDOW_PSEUDO_P) (WINDOW_TOPMOST_P, WINDOW_HAS_HORIZONTAL_SCROLL_BAR) (WINDOW_CONFIG_SCROLL_BAR_HEIGHT) (WINDOW_CONFIG_SCROLL_BAR_LINES) (WINDOW_SCROLL_BAR_LINES, WINDOW_SCROLL_BAR_AREA_HEIGHT): New macros. (WINDOW_LEFT_FRINGE_COLS, WINDOW_RIGHT_FRINGE_COLS) (WINDOW_FRINGE_COLS, WINDOW_FRINGE_EXTENDED_P): Remove macros. (WINDOW_VERTICAL_SCROLL_BAR_TYPE) (WINDOW_HAS_VERTICAL_SCROLL_BAR_ON_LEFT) (WINDOW_HAS_VERTICAL_SCROLL_BAR_ON_RIGHT) (WINDOW_HAS_VERTICAL_SCROLL_BAR): Minor rewrite. (WINDOW_BOX_HEIGHT_NO_MODE_LINE, WINDOW_BOX_TEXT_HEIGHT) (WINDOW_SCROLL_BAR_AREA_Y): Count in scroll bar height. * window.c (wset_old_pointm, Fwindow_scroll_bar_height) (Fwindow_old_point, sanitize_window_sizes): New functions. (Qwindow_sanitize_window_sizes): New symbol. (window_body_height): Count in horizontal scroll bar. (set_window_hscroll, Fscroll_left, Fscroll_right): Set suspend_auto_hscroll slot. (Fwindow_inside_edges): Count fringes pixelwise. (coordinates_in_window, Fcoordinates_in_window_p): Consider horizontal scroll bar. (check_frame_size, adjust_window_margins): Remove functions and corresponding calls. (set_window_buffer): Initialize old_pointm and horizontal scroll bars. (temp_output_buffer_show): Reset hscroll related fields. Initialize old_pointm. (make_parent_window): Initialize old_pointm. (make_window): Initialize old_pointm, horizontal scroll bar type, and scroll bar height. (resize_frame_windows): Don't count top margin in new sizes. Don't use safe sizes when shrinking a frame; let the window manager do the clipping. (Fsplit_window_internal): Inherit horizontal scroll bar type and height. (Fdelete_window_internal): Unchain old_pointm marker. (window_scroll_pixel_based, Fscroll_other_window): Adjust old_pointm. (Fwindow_text_width, Fwindow_text_height): New argument "pixelwise". (struct saved_window): New fields, old_pointm, hscroll_whole, suspend_auto_hscroll, scroll_bar_height and horizontal_scroll_bar_type. (Fset_window_configuration, save_window_save): Set new fields of saved_window. (apply_window_adjustment): Don't call adjust_window_margins. (set_window_margins): Don't change margins if new sizes don't fit into window. (set_window_scroll_bars): New argument "horizontal_type". Handle horizontal scroll bars. Don't change scroll bars if they don't fit into window. (Fset_window_scroll_bars): New argument "horizontal_type". (Fwindow_scroll_bars): Return values for horizontal scroll bars. (compare_window_configurations): Compare horizontal scroll bar settings. * xdisp.c (window_text_bottom_y, window_box_height): Count in horizontal scroll bar height. (pixel_to_glyph_coords, init_xdisp): Use FRAME_TOTAL_LINES instead of FRAME_LINES. (remember_mouse_glyph): Case ON_SCROLL_BAR changed to ON_VERTICAL_SCROLL_BAR. (with_echo_area_buffer): Initialize old_pointm. (with_echo_area_buffer_unwind_data): Store old_pointm values in vector. (unwind_with_echo_area_buffer): Handle old_pointm. (update_tool_bar): Set do_update when the tool bar window has at least one line (since this is what the user sets). (MAX_FRAME_TOOL_BAR_HEIGHT): Remove macro. (redisplay_tool_bar): Return early when toolbar has zero lines. Call x_change_tool_bar_height. Don't use max_tool_bar_height. (hscroll_window_tree): Handle suspension of auto_hscroll and old_pointm. (set_horizontal_scroll_bar): New function. (redisplay_window): Set ignore_mouse_drag_p when tool bar has more than one line. Handle horizontal scroll bars. (note_mouse_highlight): Handle horizontal scrol bars. (expose_frame): Set dimensions of XRectangle from frame's text sizes. (Vvoid_text_area_pointer): Update doc-string. * xfns.c (x_set_menu_bar_lines): Use adjust_frame_size. (x_change_tool_bar_height, x_set_scroll_bar_default_height) (x_set_internal_border_width): New functions. (x_set_tool_bar_lines): Call x_change_tool_bar_height. (unwind_create_frame_1): Remove. (Fx_create_frame): Handle horizontal scroll bars. Use official field of frame structure to inhibit running window-configuration-change-hook. (x_create_tip_frame): Call SET_FRAME_LINES and change_frame_size pixelwise. Handle frame's official field. (x_frame_parm_handlers): Add x_set_scroll_bar_height, x_set_horizontal_scroll_bars, x_set_left_fringe, x_set_right_fringe. * xmenu.c (update_frame_menubar, free_frame_menubar): Use adjust_frame_size. * xterm.h (struct x_display_info): Add horizontal_scroll_bar_cursor and Xatom_Horizontal_Scrollbar slots. (struct scroll_bar): Add horizontal slot. (HORIZONTAL_SCROLL_BAR_INSIDE_HEIGHT) (HORIZONTAL_SCROLL_BAR_LEFT_RANGE) (HORIZONTAL_SCROLL_BAR_INSIDE_WIDTH): New macros. (HORIZONTAL_SCROLL_BAR_LEFT_BORDER) (HORIZONTAL_SCROLL_BAR_RIGHT_BORDER) (HORIZONTAL_SCROLL_BAR_TOP_BORDER) (HORIZONTAL_SCROLL_BAR_BOTTOM_BORDER) (HORIZONTAL_SCROLL_BAR_MIN_HANDLE): Define. (x_clear_under_internal_border): Remove. * xterm.c (XTmouse_position): Handle horizontal scroll bars. (x_window_to_scroll_bar): New argument TYPE. Update callers. (x_send_scroll_bar_event, x_scroll_bar_create): New arguments HORIZONTAL. Update callers. (horizontal_action_hook_id): New action hook id. (x_horizontal_scroll_bar_to_input_event) (x_create_horizontal_toolkit_scroll_bar) (xt_horizontal_action_hook) (x_set_toolkit_horizontal_scroll_bar_thumb) (XTset_horizontal_scroll_bar, x_net_wm_state) (x_horizontal_scroll_bar_report_motion): New functions. (xg_scroll_callback, x_scroll_bar_handle_click): Handle horizontal scroll bars. (SCROLL_BAR_HORIZONTAL_NAME): Define. (XTset_vertical_scroll_bar): Attempt to clear areas not covered by scroll bar. (XTcondemn_scroll_bars, XTredeem_scroll_bar): Rewrite. Handle horizontal scroll bars. (handle_one_xevent): Handle horizontal scroll bar events. Call x_net_wm_state. (x_set_window_size_1, x_wm_set_size_hint): Don't call check_frame_size. (x_set_window_size): Don't call check_frame_size and do_pending_window_change. (x_term_init): Init horizontal_scroll_bar_cursor display info. (x_create_terminal): Add set_horizontal_scroll_bar_hook. (x_scroll_bar_set_handle): Add some checks when calling x_clear_area.
* | * frame.h (struct frame) [USE_X_TOOLKIT]: New member shell_position.Dmitry Antipov2014-07-201-0/+5
| | | | | | | | | | | | | | | | * xfns.c (x_window): Use it to allow xfree later. (x_encode_text): Drop 3rd arg; unused. Tweak comment and adjust users where appropriate. Use bool for booleans and remove redundant checks. (Fx_backspace_delete_keys_p): Use XkbFreeKeyboard; explain why. * xterm.c (x_free_frame_resources): Free shell_position.
* | * frame.c (frame_unspecified_color): New functionDmitry Antipov2014-07-181-5/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | refactored out from ... (Fframe_parameters, Fframe_parameter): ... adjusted users. (x_fullscreen_adjust, set_frame_param): Move Windows-specific function to ... * w32term.c (x_fullscreen_adjust, set_frame_param): ... static here. * frame.h (x_fullscreen_adjust) [HAVE_NTGUI]: * lisp.h (set_frame_param): Remove prototype. * xterm.c (x_display_pixel_width, x_display_pixel_height): Now ... * xterm.h (x_display_pixel_width, x_display_pixel_height): ... inlined from here.
* | * data.c (wrong_choice): Not static any more.Dmitry Antipov2014-07-171-4/+18
| | | | | | | | | | | | | | | | | | | | | | | | | | * lisp.h (wrong_choice): Add prototype. * frame.h (struct frame) [USE_X_TOOLKIT || HAVE_NTGUI]: Declare namebuf as such. Tweak comment. [USE_GTK]: Likewise for tool_bar_position. (fset_tool_bar_position) [USE_GTK]: Ditto. (FRAME_TOOL_BAR_POSITION): New macro. * frame.c (x_report_frame_params): * gtkutil.c (update_frame_tool_bar): * xfns.c (Fx_create_frame): Use it. (x_set_tool_bar_position): Add meaningful diagnostic messages.
* | * frame.h (enum fullscreen_type) [HAVE_WINDOW_SYSTEM]: Use more naturalDmitry Antipov2014-07-161-77/+104
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | values. Add comment. (struct frame): Re-arrange layout to avoid extra padding and use bit fields for output_method, want_fullscreen and vertical_scroll_bar_type. (FRAME_VERTICAL_SCROLL_BAR_TYPE, FRAME_HAS_VERTICAL_SCROLL_BARS) (FRAME_HAS_VERTICAL_SCROLL_BARS_ON_LEFT) (FRAME_HAS_VERTICAL_SCROLL_BARS_ON_RIGHT) [!HAVE_WINDOW_SYSTEM]: Define as no-ops because there are no scroll bars anyway. * frame.c (make_frame, make_terminal_frame, make_initial_frame): Adjust users. * font.c (fset_font_data) [HAVE_XFT || HAVE_FREETYPE]: Add convenient setter. (font_put_frame_data, font_get_frame_data): Use it.
* | More precise control over values of some buffer-local variables.Dmitry Antipov2014-07-161-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * keyboard.c (Qvertical_scroll_bar): * frame.c (Qleft, Qright): Move to ... * buffer.c (Qleft, Qright, Qvertical_scroll_bar): ... here. * buffer.c (Qchoice, Qrange, Qoverwrite_mode, Qfraction): New symbols. (syms_of_buffer): DEFSYM all of the above, attach special properties. Use special symbols to DEFVAR_PER_BUFFER overwrite-mode, vertical-scroll-bar, scroll-up-aggressively and scroll-down-aggressively. * buffer.h (Qchoice, Qrange, Qleft, Qright, Qvertical_scroll_bar): Add declarations. * nsfns.m, frame.h (Qleft, Qright): * nsterm.m (Qleft): Remove declarations. * gtkutil.c (toplevel): Include buffer.h. * data.c (wrong_choice, wrong_range): New functions. (store_symval_forwarding): Handle special properties of buffer-local variables and use functions from the above to signal error, if any.
* | Use convenient alists to manage per-frame font driver-specific data.Dmitry Antipov2014-07-031-3/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * frame.h (struct frame): Rename font_data_list to... [HAVE_XFT || HAVE_FREETYPE]: ... font_data, which is a Lisp_Object now. * font.h (struct font_data_list): Remove; no longer need a special data type. (font_put_frame_data, font_get_frame_data) [HAVE_XFT || HAVE_FREETYPE]: Adjust prototypes. * font.c (font_put_frame_data, font_get_frame_data) [HAVE_XFT || HAVE_FREETYPE]: Prefer alist functions to ad-hoc list management. * xftfont.c (xftfont_get_xft_draw, xftfont_end_for_frame): Related users changed. * ftxfont.c (ftxfont_get_gcs, ftxfont_end_for_frame): Likewise. Prefer convenient xmalloc and xfree.
* | Omit redundant extern decls.Paul Eggert2014-06-171-2/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Most of this patch is from Dmitry Antipov, in: http://lists.gnu.org/archive/html/emacs-devel/2014-06/msg00263.html * configure.ac (WERROR_CFLAGS): Add -Wredundant-decls. * lib-src/emacsclient.c (getenv): Remove decl. * lib-src/make-docfile.c (write_globals): Add ATTRIBUTE_CONST for Fbyteorder, Ftool_bar_height, Fmax_char, Fidentity. * lwlib/lwlib-Xm.c (lw_motif_widget_p, xm_update_one_value) (xm_create_dialog, xm_destroy_instance, xm_popup_menu) (xm_set_keyboard_focus, xm_set_main_areas): Remove decls. * src/commands.h (update_mode_lines): * src/frame.h (Qbackground_color, Qforeground_color) (x_set_menu_bar_lines): * src/ftfont.c (ftfont_font_format): * src/intervals.h (Qkeymap, Qfont): * src/keyboard.c (timer_check, safe_run_hooks, Qregion_extract_function): * src/lisp.h (Ffboundp, Qnil, Qt, Qlambda, Qintegerp, Qwholenump) (Qsymbolp, Qlisp, Qconsp, Qstringp, Qarrayp, Qbufferp, Qmarkerp) (Qvectorp, Qbuffer_or_string_p, Qchar_table_p, Qvector_or_char_table_p) (Qfloatp, Qnumberp, Qfont_spec, Qfont_entity, Qfont_object) (Fbyteorder, wrong_type_argument, Fmax_char, syms_of_composite) (Fidentity, extract_float, init_display, syms_of_display, Qdisplay): (Qimage, Qbox, redisplay_preserve_echo_area, char_table_ref) (char_table_set, char_table_translate, Qautoload, Qbottom, Qtop) (Qvisible, Qfont, Qfront_sticky, Qrear_nonsticky, init_sigio) (Qtool_bar, Qheader_line): * src/macros.c (Fexecute_kbd_macro): * src/xdisp.c (Ftool_bar_height, Ftool_bar_height): * src/xterm.c (x_delete_terminal, XSetIMValues): * src/xterm.h (x_set_window_size, x_query_color, x_get_focus_frame) (x_implicitly_set_name, popup_activated) (widget_store_internal_border): Remove redundant decls. * src/frame.c [USE_X_TOOLKIT]: Include widget.h. * src/keyboard.c (Fexit_recursive_edit, Fabort_recursive_edit): Remove _Noreturn, as make-docfile now does that for us. * src/lisp.h (DEFUN): Don't declare fnname here; rely on make-docfile. (Qregion_extract_function): New decl. * src/window.c, src/xfns.c: Include menu.h.
* | * frame.h (window_system_available) [!HAVE_WINDOW_SYSTEM]: Always false.Dmitry Antipov2014-06-101-1/+3
| | | | | | | | * frame.c (window_system_available) [HAVE_WINDOW_SYSTEM]: Now here.
* | * dispextern.h (last_tool_bar_item): Remove declaration.Dmitry Antipov2014-06-101-0/+5
| | | | | | | | | | | | | | | | | | * frame.h (struct frame): New member last_tool_bar_item. * frame.c (make_frame): Initialize it. * xdisp.c (toplevel): Remove last_tool_bar_item. (handle_tool_bar_click, note_tool_bar_highlight): * w32term.c (w32_read_socket, w32_initialize): * xterm.c (handle_one_xevent, x_initialize): Adjust users.
* | * frame.c, frame.h (frame_char_to_pixel_position)Paul Eggert2014-05-281-32/+0
| | | | | | | | | | (frame_set_mouse_position): Now static, and made private in frame.c rather than public in frame.h.
* | * frame.h (frame_char_to_pixel_position, frame_set_mouse_position):Dmitry Antipov2014-05-281-11/+11
| | | | | | | | Fix last change by moving these functions under HAVE_WINDOW_SYSTEM.
* | Refactor mouse positioning stuff to avoid code duplication.Dmitry Antipov2014-05-281-2/+32
| | | | | | | | | | | | | | | | | | | | | | | | | | * frame.h (frame_char_to_pixel_position): New function. (x_set_mouse_position): Rename to... (frame_set_mouse_position): ...new function. (frame_set_mouse_pixel_position): Add prototype. * nsterm.m, w32term.c, xterm.c (x_set_mouse_pixel_position): Rename to frame_set_mouse_pixel_position. * frame.c (Fset_mouse_pixel_position, Fset_mouse_position): Adjust users. * xterm.h, w32term.h ( x_set_mouse_position) (x_set_mouse_pixel_position): Remove prototypes.
* | On X, always make pointer visible when deleting frame (Bug#17609).Dmitry Antipov2014-05-281-2/+2
|/ | | | | | | | | | | * frame.c (frame_make_pointer_visible, frame_make_pointer_invisible): Pass frame as arg. * frame.h (frame_make_pointer_visible, frame_make_pointer_invisible): Adjust prototypes. * cmds.c (Fself_insert_command): Use SELECTED_FRAME. * keyboard.c (gobble_input): If there is no terminal input error, make sure the pointer is visible for all frames on this terminal. * xterm.c (x_free_frame_resources): Always enable pointer visibility.