1. 11 Apr, 2017 1 commit
    • Martin Rudalics's avatar
      Frame movement, focus and hook related changes · ea6c880a
      Martin Rudalics authored
      New hook `move-frame-functions'.  Run `focus-in-hook'
      after switching to frame that gets focus.  Don't run
      XMoveWindow for GTK.
      
      * lisp/frame.el (handle-move-frame, frame-size-changed-p): New
      functions.
      
      * src/frame.c (do_switch_frame): Simplify code.
      (Fhandle_switch_frame): Switch frame before running
      `handle-focus-in'.
      (Vfocus_in_hook, Vfocus_out_hook): Clarify doc-strings.
      (Vmove_frame_functions): New hook variable.
      * src/keyboard.c (kbd_buffer_get_event): Handle
      MOVE_FRAME_EVENT.  Handle SELECT_WINDOW_EVENT separately.
      (head_table): Add Qmove_frame entry.
      (syms_of_keyboard): Add Qmove_frame.
      (keys_of_keyboard): Define key for `move-frame'.
      * src/termhooks.h (event_kind): Add MOVE_FRAME_EVENT.
      * src/w32term.c (w32_read_socket): Create MOVE_FRAME_EVENT.
      * src/window.c (run_window_size_change_functions): Record size of
      FRAME's minibuffer window too.
      * src/xterm.c (handle_one_xevent): Create MOVE_FRAME_EVENT.
      (x_set_offset): For GTK call gtk_widget_move instead of
      XMoveWindow.
      ea6c880a
  2. 06 Mar, 2017 1 commit
    • Eli Zaretskii's avatar
      A better fix for bug#25845 · eae5dcd5
      Eli Zaretskii authored
      * src/xdisp.c (font_for_underline_metrics): New function.
      * src/dispextern.h: Add its prototype.
      * src/xterm.c (x_draw_glyph_string):
      * src/w32term.c (x_draw_glyph_string):
      * src/nsterm.m (ns_draw_text_decoration): Call it.  This avoids
      having identical code 3 times in 3 different files.
      eae5dcd5
  3. 05 Mar, 2017 1 commit
    • Eli Zaretskii's avatar
      Fix display of cursor on underlined text · 8e1ae12c
      Eli Zaretskii authored
      * src/nsterm.m (ns_draw_text_decoration):
      * src/xterm.c (x_draw_glyph_string):
      * src/w32term.c (x_draw_glyph_string): Compute the position and
      thickness of the underline by looking for the first glyph of the
      run of underlined glyphs that includes the glyph string we are
      drawing.  (Bug#25845)
      8e1ae12c
  4. 02 Mar, 2017 1 commit
    • Eli Zaretskii's avatar
      Fix display of strike-through text in variable-height lines · 511a3c3b
      Eli Zaretskii authored
      * src/nsterm.m (ns_draw_text_decoration):
      * src/xterm.c (x_draw_glyph_string):
      * src/w32term.c (x_draw_glyph_string): Fix calculation of the
      strike-through y-coordinate for a glyph row which is taller than
      the strike-through text.  (Bug#25907)
      511a3c3b
  5. 28 Feb, 2017 1 commit
    • Ken Brown's avatar
      Try to avoid hang when logging out of MS-Windows · 57f5ab8c
      Ken Brown authored
      * src/w32term.c (x_update_window_begin, x_update_window_end)
      (my_show_window, my_set_window_pos, my_set_focus)
      (my_set_foreground_window, my_destroy_window)
      (my_bring_window_to_top, x_iconify_frame): Replace calls to
      SendMessage by calls to SendMessageTimeout with a 6-second
      timeout.  (Bug#25875)
      57f5ab8c
  6. 01 Jan, 2017 1 commit
  7. 28 Nov, 2016 1 commit
    • Eli Zaretskii's avatar
      Fix 'expand-file-name' during startup on MS-Windows · 5878abf8
      Eli Zaretskii authored
      * src/w32.c (w32_init_file_name_codepage): New function, resets
      file_name_codepage and w32_ansi_code_page to undo the values
      recorded during dumping.
      (codepage_for_filenames): Fix an embarrassing typo.  Ignore the
      cached value of file-name encoding if it is nil, i.e. not
      initialized yet.  Actually cache the last used file-name encoding
      to avoid calling APIs when not necessary.
      
      * src/w32.h (w32_init_file_name_codepage): Add prototype.
      
      * src/w32term.c (syms_of_w32term): Set the value of
      w32_unicode_filenames according to the OS version.  This avoids
      resetting it during startup, which then causes temacs to run with
      the incorrect value.
      
      * src/emacs.c (main): Call w32_init_file_name_codepage early
      during the startup.
      
      * src/fileio.c (Fexpand_file_name) [WINDOWSNT]: Update 'newdir'
      after converting $HOME to a UTF-8 string, so that 'newdirlim' is
      consistent with it.  (Bug#25038)
      
      * lisp/international/mule-cmds.el (set-locale-environment): Set
      'default-file-name-coding-system' to the ANSI codepage even in
      non-interactive sessions.
      
      * lisp/files.el (directory-abbrev-alist, abbreviated-home-dir):
      Doc fix.
      (abbreviate-file-name): Decode 'abbreviated-home-dir' if it is a
      unibyte string.
      
      * doc/lispref/files.texi (Directory Names): Index
      'directory-abbrev-alist'.
      5878abf8
  8. 20 Nov, 2016 1 commit
    • Eli Zaretskii's avatar
      Fix redrawing non-selected frame after resize on MS-Windows · 56a47981
      Eli Zaretskii authored
      * src/xdisp.c (redisplay_internal): If all the frames were
      successfully updated, reset the "garbaged" flag of each frame, to
      make sure it doesn't stay set.
      
      * src/w32term.c (w32_read_socket): Don't clear the frame if it's
      "garbaged", since expose_frame won't redraw the foreground then.
      (Bug#24642)
      56a47981
  9. 29 Oct, 2016 1 commit
    • Eli Zaretskii's avatar
      Unbreak MS-Windows build · aaa3a93e
      Eli Zaretskii authored
      * src/w32term.c (XCreateGC): Second argument is now HWND, and its
      name is "wignore".
      (x_set_cursor_gc, x_set_mouse_face_gc)
      (x_draw_glyph_string_background, x_draw_glyph_string_bg_rect)
      (x_draw_image_glyph_string, x_draw_stretch_glyph_string): Don't
      use s->window, which doesn't exist anymore.
      
      * src/w32term.h (XCreateGC): Adjust prototype.
      aaa3a93e
  10. 12 Jul, 2016 2 commits
    • John Wiegley's avatar
      Revert "Cleanup tooltips" · 54b7eb0d
      John Wiegley authored
      This reverts commit 20038f8a.
      
      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.
      54b7eb0d
    • Dmitry Antipov's avatar
      Cleanup tooltips · 20038f8a
      Dmitry Antipov authored
      * 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'.
      20038f8a
  11. 02 Jul, 2016 1 commit
    • Eli Zaretskii's avatar
      Rename FACE_OPT_FROM_ID to FACE_FROM_ID_OR_NULL · 55d38fc8
      Eli Zaretskii authored
      * src/dispextern.h (FACE_FROM_ID_OR_NULL): Renamed from
      FACE_OPT_FROM_ID; all callers changed.
      * src/xdisp.c (extend_face_to_end_of_line): Call FACE_FROM_ID, not
      FACE_FROM_ID_OR_NULL, as the resulting face is immediately
      dereferenced.
      (fill_gstring_glyph_string): Call FACE_FROM_ID, not
      FACE_FROM_ID_OR_NULL, as the resulting face will be dereferenced
      when the glyph string is drawn.
      (BUILD_COMPOSITE_GLYPH_STRING): Call FACE_FROM_ID, not
      FACE_FROM_ID_OR_NULL, as the resulting face will be dereferenced
      in fill_composite_glyph_string.
      (calc_line_height_property): Call FACE_FROM_ID_OR_NULL rather that
      FACE_FROM_ID, since the function and its caller can cope with that
      situation.  Conflate 3 tests of missing face or font into just
      one.
      * src/xfaces.c (Fx_list_fonts, Fface_font, lookup_face): Call
      FACE_FROM_ID_OR_NULL rather that FACE_FROM_ID, since these
      functions can cope with that situation.
      (lookup_derived_face): Don't call FACE_FROM_ID if the result will
      not be used.
      * src/w32console.c (w32_face_attributes): Remove redundant 'eassert'.
      55d38fc8
  12. 21 Jun, 2016 1 commit
    • Ken Brown's avatar
      Fix compiler warnings in Cygwin-w32 build · 560c4ab1
      Ken Brown authored
      * src/conf_post.h (DebPrint) [!EMACSDEBUG]: Add empty do-while
      loop to avoid compiler warnings about empty body of 'if'
      statement.
      
      * src/image.c [HAVE_NTGUI] (DefaultDepthOfScreen): Disable unused
      macro.
      (x_create_bitmap_from_data): Declare 'frame'.
      (x_create_bitmap_from_file): Don't declare unused variable
      'dpyinfo'.
      
      * src/lisp.h (AUTO_STRING_WITH_LEN): Avoid initialization to
      prevent "jump-misses-init" compiler warnings.
      
      * src/w32fns.c (check_w32_winkey_state): Define and use only if
      WINDOWSNT.
      (Fx_show_tip): Declare 'f'.
      (Fx_file_dialog): Declare 'filter_a' only if not NTGUI_UNICODE.
      (w32_strerror): Use format specifier %d for sprintf argument of
      type int.
      (emacs_abort): Cast sprintf argument of type DWORD to unsigned
      int, and use format specifier %x, for compatibility with Cygwin.
      (unicode_append_menu) [NTGUI_UNICODE]:
      * src/w32menu.c [NTGUI_UNICODE] (get_menu_item_info)
      (set_menu_item_info, unicode_append_menu)
      (unicode_message_box):
      * src/menu.c [NTGUI_UNICODE] (unicode_append_menu): Define as
      functions rather than macros to avoid "address will always
      evaluate as true" compiler warnings.
      
      * src/w32font.c (w32_to_x_charset): Use format specifier %d for
      sprintf argument of type int.
      
      * src/w32term.c (x_draw_glyphless_glyph_string_foreground): Cast
      sprintf argument of type int to unsigned int to match %X format
      specifier.
      (w32_scroll_bar_handle_click):
      (w32_horizontal_scroll_bar_handle_click): Declare 'f'.
      
      * src/w32term.h (FRAME_DISPLAY_INFO): Explicitly discard unused
      argument.
      560c4ab1
  13. 21 May, 2016 1 commit
    • Eli Zaretskii's avatar
      Fix compiler warnings in the MinGW build · cb5af792
      Eli Zaretskii authored
      * configure.ac [mingw32]: Don't add -Wpointer-sign, and add
      -Wno-pointer-sign, to keep the noise level down.
      
      * nt/mingw-cfg.site (gl_cv_warn_c__Wredundant_decls): Disable
      -Wredundant-decls, as that produces a lot of noise due to
      redeclaration of time-related functions by gnulib.
      * nt/runemacs.c (set_user_model_id): Fix argument type of
      'SetCurrentProcessExplicitAppUserModelID'.
      
      * src/image.c (x_create_bitmap_from_file) [HAVE_NTGUI]: Don't
      declare 'dpyinfo', as it is unused.
      (xpm_load): Fix warnings about pointer signedness.
      * src/w32proc.c (IsValidLocale, init_winsock): Remove redundant
      prototypes.
      (sys_spawnve): Avoid warnings about discarding 'const' qualifier.
      (sys_select): Provide prototype.
      (g_b_init_compare_string_w): Move declaration to file scope.
      * src/w32heap.c (dumped_data_commit): Now static.
      (FREEABLE_P): Avoid warnings about pointer comparison with integer.
      (mmap_realloc): Cast to 'char *' for arithmetics on void pointers.
      * src/w32console.c (ctrl_c_handler, sys_tputs, sys_tgetstr)
      (evalcost, cmputc, cmcheckmagic, cmcostinit, cmgoto, Wcm_clear):
      Provide prototypes.
      * src/w32.c (globals_of_w32, conv_sockaddr_to_lisp): Remove
      redundant prototypes.
      (w32_get_internal_run_time, map_w32_filename): Provide prototype.
      (init_environment, sys_ctime): Avoid warnings about discarding
      'const' qualifier.
      Include utimens.h.
      (sys_ctime, sys_chdir, sys_creat, sys_fopen, sys_mkdir)
      (sys_open, sys_rename, sys_rmdir, is_slow_fs, term_winsock)
      (sys_close, sys_dup2, sys_read, sys_write, sys_localtime): Provide
      prototypes.
      (sys_rename_replace): Use %d to avoid compiler warnings.
      (_wsa_errlist): Make the message text 'const char *', to avoid
      compilation warnings.
      (dynlib_reset_last_error): Move prototype to file scope.
      (w32_get_resource): First argument is now 'const char *'.
      * src/w32uniscribe.c (syms_of_w32uniscribe): Provide prototype.
      (otf_features): Second argument is no 'const char *'.
      * src/w32term.c (free_frame_menubar, x_wm_set_size_hint)
      (x_set_window_size): Remove redundant prototypes.
      (XChangeGC, XGetGCValues, w32_draw_underwave)
      (w32_draw_rectangle, w32_shift_glyphs_for_insert, x_mouse_leave)
      (x_calc_absolute_position, x_destroy_window): Now static.
      (menubar_selection_callback): Move prototype to file scope.
      * src/w32font.c (g_b_init_get_glyph_outline_w): Remove redundant
      declaration.
      (w32_to_x_charset): Fix warnings about discarding 'const' qualifier.
      (w32font_full_name): Fix warnings about implicit conversion of
      'float' to 'double'.
      * src/w32reg.c (w32_get_rdb_resource): Fix warnings about
      discarding 'const' qualifier.
      * src/w32menu.c (syms_of_w32menu, globals_of_w32menu)
      (set_frame_menubar): Remove redundant prototypes.
      (menubar_selection_callback, w32_menu_display_help): Provide
      prototypes.
      (simple_dialog_show): Avoid warnings about discarding 'const'
      qualifier.
      * src/w32fns.c (syms_of_w32fns, globals_of_w32fns)
      (free_frame_menubar, w32_strerror, x_set_menu_bar_lines)
      (x_set_tool_bar_lines, x_set_internal_border_width): Remove
      redundant prototypes.
      (current_popup_menu): Remove redundant declaration.
      (colormap_t): Member 'name' is now 'const char *'.
      (add_system_logical_colors_to_map): Fix signed/unsigned warnings.
      (x_decode_color, x_set_border_pixel)
      (x_clear_under_internal_border, x_set_name, hook_w32_key)
      (reset_w32_kbdhook_state, deliver_wm_chars, w32_backtrace): Now
      static.
      (w32_load_cursor, w32_key_to_modifier, map_keypad_keys)
      (w32_msg_worker, w32_last_error): Provide prototypes.
      (funhook, lookup_vk_code): Avoid warnings about missing
      parentheses.
      (x_default_font_parameter, Fw32_notification_notify): Avoid
      warnings about discarding 'const' qualifier.
      (Fx_create_frame): Avoid warnings about empty body of 'else'.
      (x_screen_planes): Ifdef away unused function.
      (Fx_show_tip): Remove unused variables.
      (Fw32_battery_status): Avoid warnings about implicit promotion
      from float to double.
      (Fw32_notification_notify): Initialize 'timeout'.
      * src/profiler.c (profiler_cpu_running) [HAVE_ITIMERSPEC]: Only
      define the TIMER_SETTIME_RUNNING value if it will be used.
      * src/w32notify.c (send_notifications): Ifdef away an empty if
      clause.  Remove unused variable.
      (watch_end, watch_completion): Provide prototypes.
      * src/sound.c (sound_warning) [WINDOWSNT]: Don't define: unused.
      * src/callproc.c (child_setup, getenv_internal_1) [WINDOWSNT]: Fix
      warning with pointer signedness.
      * src/gnutls.c (gnutls_x509_crt_get_signature)
      (gnutls_alert_send_appropriate) [WINDOWSNT]: Don't define, and
      don't load them from the GnuTLS library, as they are no longer
      used.
      * src/process.c (DATAGRAM_CHAN_P) [!DATAGRAM_SOCKETS]: Don't
      define, as it's unused.
      * src/unexw32.c (open_input_file, open_output_file)
      (close_file_data): Remove redundant prototypes.
      (_start): provide prototype.
      (mainCRTStartup): Move prototype to file level.
      (find_section): Use type-cast to shut up compiler warnings.
      (offset_to_section, relocate_offset): Now static.
      (find_section): First argument is now a 'const char *'.
      (offset_to_section): Ifdef away, as it's unused.
      * src/w32heap.h (find_section): Adjust prototype.
      * src/dynlib.c (dynlib_reset_last_error): Provide prototype.
      * src/dired.c (directory_files_internal_w32_unwind): Avoid
      warnings about missing prototypes.
      (is_slow_fs) [WINDOWSNT]: Provide prototype at file level.
      (directory_files_internal) [WINDOWSNT]: Fix warnings about pointer
      signedness.
      * src/fileio.c (Ffile_writable_p, Ffile_regular_p) [WINDOWSNT]:
      Fix warnings about pointer signedness.
      * src/filelock.c (WTMP_FILE) [WINDOWSNT]: Don't define, it's
      unused.
      * src/sysdep.c (_getpid): Remove redundant prototype.
      (sys_subshell) [DOS_NT]: Don't define 'status', it's unused.
      [!MSDOS]: Don't define 'st', it's unused.
      (init_sys_modes) [DOS_NT]: Don't define 'terminal', it's unused.
      (str_collate) [WINDOWSNT]: Avoid warnings about pointer signedness.
      * src/keyboard.c (tty_read_avail_input) [WINDOWSNT]: Don't define
      n_to_read, as it is not used.
      (MAX_ENCODED_BYTES) [WINDOWSNT]: Don't define, as it's unused.
      * src/w32font.h (syms_of_w32font): Remove redundant prototype.
      * src/xfaces.c (x_display_info) [HAVE_NTGUI]: Remove unused macro.
      * src/term.c (init_tty) [DOS_NT]: Ifdef away variables that are
      not used by DOS_NT builds, to avoid compiler warnings.
      * src/menu.c (current_popup_menu) [HAVE_NTGUI]: Remove redundant
      declaration.
      * src/dispnew.c (init_display) [WINDOWSNT]: Use type-cast to shut
      up compiler warnings.
      * src/w32term.h (x_set_window_size, x_get_focus_frame)
      (x_make_frame_visible, x_make_frame_invisible, x_iconify_frame)
      (x_set_frame_alpha, x_activate_menubar, x_bitmap_icon)
      (x_free_frame_resources, x_real_positions)
      (display_x_get_resource): Remove redundant prototypes.
      
      * lib-src/ntlib.c (sys_ctime, sys_fopen, sys_chdir, mkostemp)
      (sys_rename, gettimeofday): Provide prototypes.
      * lib-src/ntlib.h (getuid, geteuid, mkostemp): Remove redundant
      declarations.
      * lib-src/emacsclient.c (w32_getenv): Argument is now 'const char *'.
      (xstrdup, w32_get_resource, w32_window_app, w32_execvp, ttyname)
      (close_winsock, initialize_sockets, w32_set_user_model_id)
      (w32_find_emacs_process, w32_give_focus) [WINDOWSNT]: Add
      prototypes.
      (w32_get_resource) [WINDOWSNT]: Fix a warning about signedness
      difference.
      (w32_set_user_model_id): Update prototype of
      SetCurrentProcessExplicitAppUserModelID to avoid compiler
      warnings.
      (start_daemon_and_retry_set_socket) [WINDOWSNT]: Use type-cast to
      shut up compiler warnings.
      * lib-src/etags.c (MAXPATHLEN) [WINDOWSNT]: Remove unused macro.
      cb5af792
  14. 18 May, 2016 1 commit
    • Paul Eggert's avatar
      Port --enable-gcc-warnings to GCC 6.1 · 374f6a5f
      Paul Eggert authored
      * configure.ac (WERROR_CFLAGS): Omit -Wunused-const-variable=2.
      * lib-src/etags.c (LOOKING_AT, LOOKING_AT_NOCASE):
      Omit test whether pointer plus a constant equals a null pointer.
      * src/alloc.c (compact_small_strings):
      Avoid pointer arithmetic on null pointers.
      * src/alloc.c (mark_face_cache):
      * src/fontset.c (free_realized_fontsets, Fset_fontset_font):
      * src/fringe.c (draw_fringe_bitmap_1)
      (Fset_fringe_bitmap_face):
      * src/macfont.m (macfont_draw):
      * src/msdos.c (IT_set_face, IT_clear_screen):
      * src/nsfont.m (nsfont_draw):
      * src/nsterm.h (FRAME_DEFAULT_FACE):
      * src/nsterm.m (ns_draw_window_cursor)
      (ns_draw_vertical_window_border, ns_draw_window_divider)
      (ns_dumpglyphs_box_or_relief)
      (ns_maybe_dumpglyphs_background, ns_dumpglyphs_image)
      (ns_dumpglyphs_stretch):
      * src/w32term.c (w32_draw_vertical_window_border)
      (w32_draw_window_divider, x_set_mouse_face_gc):
      * src/xdisp.c (estimate_mode_line_height, init_iterator)
      (handle_face_prop, handle_single_display_spec, pop_it)
      (CHAR_COMPOSED_P, get_next_display_element)
      (next_element_from_display_vector, extend_face_to_end_of_line)
      (fill_gstring_glyph_string,BUILD_COMPOSITE_GLYPH_STRING):
      * src/xfaces.c (Finternal_merge_in_global_face, Fface_font)
      (lookup_named_face):
      * src/xterm.c (x_draw_vertical_window_border)
      (x_draw_window_divider, x_set_mouse_face_gc):
      Prefer FACE_OPT_FROM_ID to FACE_FROM_ID when the result might be null.
      * src/xterm.c (try_window_id):
      Redo loop to convince GCC 6.1 that it is null pointer safe.
      (x_color_cells):
      Use eassume as necessary to pacify GCC 6.1.
      * src/dispextern.h (FACE_FROM_ID, IMAGE_FROM_ID): Now returns non-null.
      (FACE_OPT_FROM_ID, IMAGE_OPT_FROM_ID): New macro, with the old
      behavior of the non-_OPT macro, to be used when the result
      might be a null pointer.
      * src/dispnew.c (buffer_posn_from_coords, marginal_area_string)
      [HAVE_WINDOW_SYSTEM]:
      * src/intervals.h (INTERVAL_WRITABLE_P):
      * src/term.c (turn_off_face):
      * src/xdisp.c (get_glyph_face_and_encoding, fill_image_glyph_string)
      (produce_image_glyph, produce_xwidget_glyph):
      * src/xfaces.c (lookup_named_face):
      Remove unnecessary test for null pointer.
      * src/keyboard.c (read_char): Suppress bogus -Wclobbered warning.
      * src/process.c (would_block): New function.
      (server_accept_connection, wait_reading_process_output, send_process):
      Use it.
      * src/xdisp.c (get_window_cursor_type, note_mouse_highlight):
      Prefer IMAGE_OPT_FROM_ID to IMAGE_FROM_ID when the result
      might be null.
      374f6a5f
  15. 12 May, 2016 1 commit
    • Ken Brown's avatar
      Autosave buffers on logout if HAVE_NTGUI · 6435f41f
      Ken Brown authored
      * src/w32fns.c (w32_wnd_proc): Pass a WM_ENDSESSION message on to
      w32_read_socket.
      
      * src/w32term.c (w32_read_socket): Create an event of type
      END_SESSION_EVENT if a WM_ENDSESSION message is received.
      
      * src/termhooks.h [HAVE_NTGUI]: New event kind END_SESSION_EVENT.
      
      * src/keyboard.c [HAVE_NTGUI] (syms_of_keyboard): New symbol
      `end-session'.
      (kbd_buffer_get_event): Return an end-session event if an event of
      type END_SESSION_EVENT is read.
      (keys_of_keyboard): Bind the end-session event to kill-emacs in
      special-event-map.  (Bug#23483)
      6435f41f
  16. 22 Apr, 2016 1 commit
  17. 19 Mar, 2016 1 commit
    • Fabrice Popineau's avatar
      Improve w32notify notifications · 326fff41
      Fabrice Popineau authored
      * src/w32notify.c (DIRWATCH_BUFFER_SIZE): New macro.
      (struct notification): 'terminate' is now a HANDLE.
      (send_notifications): Argument is now a pointer to a
      notification.  Don't loop waiting for the notification to be
      acknowledged by the main thread; instead, just add the
      notification to the linked list of notifications waiting to be
      acknowledged.
      (watch_end): Don't close the directory handle.
      (watch_completion): Allocate a new notification structure to be
      added to the notifications set.  Call ReadDirectoryChangesW
      immediately after adding the new notification, and before sending
      a message to the main thread about them.
      (watch_worker): Don't loop calling ReadDirectoryChangesW; instead,
      call it just once -- it will be called again in watch_completion.
      Loop waiting for the main thread's indication to terminate.
      (start_watching): Create the event to be used to indicate to the
      worker thread that its should terminate.
      (remove_watch): Indicate to the worker thread that it should
      terminate.
      * src/w32term.c (queue_notifications): Loop over all the
      notifications in the linked list, processing all of them in one
      go.
      * src/w32inevt.c (handle_file_notifications): Loop over all the
      notifications in the linked list.
      * src/w32xfns.c (init_crit): Initialize the linked list of file
      notifications.
      (delete_crit): Free the linked list of file notifications,
      including any unprocessed notifications left in it.
      * src/w32term.h (struct notifications_se): New struct.
      
      * test/lisp/filenotify-tests.el (file-notify-test02-events)
      (file-notify-test05-dir-validity): Add read-event calls to
      facilitate event recognition by the main thread in batch mode.
      326fff41
  18. 10 Mar, 2016 1 commit
    • Paul Eggert's avatar
      Rework C source files to avoid ^( · 7352c6c6
      Paul Eggert authored
      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.
      7352c6c6
  19. 24 Jan, 2016 1 commit
    • Alan Mackenzie's avatar
      Expunge "allow" + infinitive without direct object from source and doc. · fbce4757
      Alan Mackenzie authored
      Do the same for "permit", "enable", and "prevent".
      
      * doc/emacs/mule.texi:
      * doc/lispref/control.texi:
      * doc/lispref/display.texi:
      * doc/lispref/frames.texi:
      * doc/lispref/functions.texi:
      * doc/lispref/nonascii.texi:
      * doc/lispref/streams.texi:
      * doc/lispref/windows.texi:
      * doc/misc/dbus.texi:
      * doc/misc/eww.texi:
      * doc/misc/flymake.texi:
      * doc/misc/octave-mode.texi:
      * doc/misc/org.texi:
      * doc/misc/reftex.texi:
      * doc/misc/tramp.texi:
      * doc/misc/wisent.texi:
      * etc/NEWS:
      * lisp/autorevert.el:
      * lisp/cedet/mode-local.el:
      * lisp/cedet/semantic/senator.el:
      * lisp/cedet/semantic/wisent.el:
      * lisp/dos-fns.el:
      * lisp/frameset.el:
      * lisp/gnus/gnus-agent.el:
      * lisp/gnus/mm-util.el:
      * lisp/international/characters.el:
      * lisp/ldefs-boot.el:
      * lisp/mail/mailclient.el:
      * lisp/man.el:
      * lisp/mh-e/mh-search.el:
      * lisp/net/tramp-cmds.el:
      * lisp/net/tramp-gvfs.el:
      * lisp/org/org-crypt.el:
      * lisp/org/org-element.el:
      * lisp/org/org-feed.el:
      * lisp/org/org.el:
      * lisp/org/ox-ascii.el:
      * lisp/org/ox-icalendar.el:
      * lisp/org/ox-publish.el:
      * lisp/org/ox.el:
      * lisp/play/gamegrid.el:
      * lisp/play/gomoku.el:
      * lisp/progmodes/antlr-mode.el:
      * lisp/progmodes/python.el:
      * lisp/progmodes/vhdl-mode.el:
      * lisp/strokes.el:
      * lisp/textmodes/ispell.el:
      * lisp/tree-widget.el:
      * lisp/vc/pcvs.el:
      * lisp/window.el:
      * src/lisp.h:
      * src/w32.c:
      * src/w32heap.c:
      * src/w32term.c:
      * src/window.c:
      * src/xfaces.c:
      
      Replace solecisms like "This allow to do something" with a correct
      alternative, such as "This allow you to do something", "This allows
      something to be done" or "This allows the doing of something".
      fbce4757
  20. 01 Jan, 2016 1 commit
  21. 27 Dec, 2015 1 commit
    • Eli Zaretskii's avatar
      Avoid leaving "ghost" of mouse pointer on MS-Windows · 3ad99c46
      Eli Zaretskii authored
      * src/w32term.c (frame_set_mouse_pixel_position):
      * src/w32fns.c (Fw32_mouse_absolute_pixel_position): Momentarily
      disable "mouse trails" when moving the mouse pointer.  (Bug#22247)
      * src/w32term.c (frame_set_mouse_pixel_position): Include
      w32common.h.
      3ad99c46
  22. 12 Dec, 2015 1 commit
    • Martin Rudalics's avatar
      Fix frame height calculations with added menu bar on Windows (Bug#22105) · 06f00d39
      Martin Rudalics authored
      * doc/lispref/frames.texi (Parameter Access): Mention pitfalls
      when simultaneously specifying multiple parameters for
      `modify-frame-parameters' that all may change the frame's size.
      * src/w32fns.c (x_set_menu_bar_lines): Don't set
      windows_or_buffers_changed here.
      (my_create_tip_window, Fx_show_tip): Call AdjustWindowRect
      with third argument false.
      * src/w32menu.c (set_frame_menubar): Set
      windows_or_buffers_changed here.
      * src/w32term.c (x_set_window_size): Determine third argument of
      AdjustWindowRect from whether the frame has a menu bar and not
      from whether it wants one.
      06f00d39
  23. 21 Nov, 2015 1 commit
    • Eli Zaretskii's avatar
      Simplify recording of main thread's ID on MS-Windows · d696d62f
      Eli Zaretskii authored
      * src/w32term.c (w32_initialize):
      * src/w32console.c (initialize_w32_display):
      * src/w32fns.c (globals_of_w32fns): Don't record the main thread
      ID independently for each type of session (GUI, TTY, batch).
      * src/w32term.c (w32_init_main_thread): New function, records the
      main thread's thread ID.
      * src/w32term.h: Add prototype for w32_init_main_thread.
      * src/emacs.c (main) [WINDOWSNT]: Call w32_init_main_thread.
      
      * src/emacs-module.c [WINDOWSNT]: Rename main_thread_id to
      main_thread, for consistency with other threading libraries.  All
      users changed.  Include w32term.h.
      (check_main_thread) [WINDOWSNT]: Simplify the test: no need to
      make sure the main thread is alive, as we hold a handle on it
      opened by w32_init_main_thread.
      (module_init) [WINDOWSNT]: Reuse the thread ID recorded by
      w32_init_main_thread, instead of calling the requisite APIs once
      more.
      d696d62f
  24. 29 Oct, 2015 1 commit
  25. 22 Oct, 2015 1 commit
    • Eli Zaretskii's avatar
      Include file cleanup for w32 files in src directory · d4352f81
      Eli Zaretskii authored
      * src/w32xfns.c: Don't include keyboard.h, window.h, charset.h,
      fontset.h, blockinput.h.
      * src/w32uniscribe.c: Don't include dispextern.h, character.h,
      charset.h, fontset.h.
      * src/w32term.c: Don't include systty.h, systime.h, charset.h,
      character.h, ccl.h, dispextern.h, disptab.h, intervals.h,
      process.h, atimer.h, keymap.h, w32heap.h.  Include bitmap/gray.xbm
      in an ifdef-ed away block.
      Include fcntl.h for CYGWIN.
      (set_frame_param): Remove unused function.
      * src/w32select.c: Don't include charset.h and composite.h.
      (setup_config, Fw32_get_clipboard_data): Avoid compiler warnings
      due to pointer signedness mismatches.
      * src/w32reg.c (w32_get_string_resource): Avoid compiler warnings
      due to pointer signedness mismatches.
      * src/w32proc.c: Include unistd.h.  Don't include systime.h,
      process.h, dispextern.h.
      (sys_spawnve, Fw32_short_file_name, Fw32_long_file_name)
      (Fw32_application_type): Avoid compiler warnings due to pointer
      signedness mismatches.
      * src/w32menu.c: Don't include keymap.h, termhooks.h, window.h,
      character.h, charset.h, dispextern.h.
      (simple_dialog_show, add_menu_item): Avoid compiler warnings due
      to pointer signedness mismatches.
      * src/w32inevt.c: Don't include dispextern.h, window.h,
      termhooks.h, w32heap.h.
      * src/w32font.c: Don't include dispextern.h, character.h,
      charset.h, fontset.h, font.h.
      (intern_font_name, add_font_entity_to_list)
      (registry_to_w32_charset, w32_to_x_charset, fill_in_logfont)
      (list_all_matching_fonts): Avoid compiler warnings due to pointer
      signedness mismatches.
      * src/w32fns.c: Don't include character.h, intervals.h,
      dispextern.h, epaths.h, charset.h, ccl.h, fontset.h, systime.h,
      termhooks.h, w32heap.h, bitmap/gray.xbm, font.h, w32font.h.
      (w32_color_map_lookup, add_system_logical_colors_to_map)
      (x_decode_color, x_set_name, FPRINTF_WM_CHARS, Fxw_color_defined_p)
      (Fxw_color_values, x_display_info_for_name, Fset_message_beep)
      (x_create_tip_frame, Fx_file_dialog, Fsystem_move_file_to_trash)
      (w32_parse_hot_key, Ffile_system_info, w32_kbd_patch_key): Avoid
      compiler warnings, mainly due to pointer signedness mismatches.
      (unwind_create_frame_1): Remove unused function.
      * src/w32console.c: Don't include character.h, disptab.h, frame.h,
      window.h, termhooks.h, dispextern.h.
      (w32con_write_glyphs, w32con_write_glyphs_with_face): Fix pointer
      signedness mismatch.
      * src/w32.c: Include c-strcase.h and systty.h.  Don't include
      w32heap.h.
      d4352f81
  26. 13 Oct, 2015 1 commit
    • Martin Rudalics's avatar
      Allow setting frame pixel sizes from frame parameters (Bug#21415) · d4fe840d
      Martin Rudalics authored
      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.
      d4fe840d
  27. 12 Oct, 2015 1 commit
    • Juanma Barranquero's avatar
      Remove or comment out unused variables · 4462823e
      Juanma Barranquero authored
      * src/w32fns.c (x_set_mouse_color): Comment out variables cursor,
      nontext_cursor, mode_cursor, hand_cursor and count.
      (x_change_tool_bar_height): Remove variable old_text_height.
      (deliver_wm_chars): Remove variable strip_Alt.
      (Fw32_shell_execute): Remove variable document_a.
      (Fw32_frame_geometry): Remove variable fullboth.
      * src/w32term.c (w32_setup_relief_color): Comment out variable
      w32_display_info.
      (w32_horizontal_scroll_bar_handle_click): Remove variables start, end.
      (w32_read_socket): Comment out variables rows, columns.
      * src/w32uniscribe.c (uniscribe_check_otf_1): Remove variable rest.
      4462823e
  28. 31 Aug, 2015 1 commit
  29. 26 Jun, 2015 2 commits
    • Eli Zaretskii's avatar
      Fix invisible mouse pointers on Windows. · f1427563
      Eli Zaretskii authored
      * src/w32fns.c: Include windowsx.h.
      (w32_wnd_proc): If the mouse moved and the mouse pointer is
      invisible, make it visible again even when the main (Lisp)
      thread is busy.
      * src/w32term.c (w32_toggle_invisible_pointer): Rather then
      garbaging the frame have the input thread call SetCursor.
      f1427563
    • Martin Rudalics's avatar
      Provide invisible mouse pointers on Windows. (Bug#6105) (Bug#12922) · 605765af
      Martin Rudalics authored
      * src/w32fns.c (w32_wnd_proc): Handle f->pointer_invisible
      for WM_SETCURSOR and WM_EMACS_SETCURSOR cases.
      * src/w32term.c (w32_hide_hourglass): Handle
      f->pointer_invisible.
      (w32_toggle_invisible_pointer): New function.
      (w32_create_terminal): Add w32_toggle_invisible_pointer as
      toggle_invisible_pointer_hook for this terminal.
      605765af
  30. 31 May, 2015 1 commit
    • Eli Zaretskii's avatar
      Attempt to fix crashes due to accesses beyond glyph matrix end · cab645a6
      Eli Zaretskii authored
      * src/xdisp.c (x_produce_glyphs): When it->ascent and it->descent
      are determined from per-character metrics, don't let the
      max_ascent and max_descent become smaller than values returned by
      normal_char_ascent_descent, to avoid unpleasant dynamic resizing
      of screen line heights when text changes.
      
      * src/xterm.c (x_new_font)
      * src/w32term.c (x_new_font): Call get_font_ascent_descent to
      obtain a reasonable value for FRAME_LINE_HEIGHT, even when a font
      claims very large value for its height.
      
      * src/font.c (font_open_entity): Call get_font_ascent_descent to
      obtain a reasonable value for FRAME_SMALLEST_FONT_HEIGHT, even
      when a font claims very large value for its height.
      cab645a6
  31. 28 May, 2015 1 commit
    • Eli Zaretskii's avatar
      Fix display of glyphless characters with problematic fonts · c76605fa
      Eli Zaretskii authored
      * src/w32term.c (x_draw_glyph_string_background): Force redraw of
      glyph string background also when the font in use claims
      preposterously large global height value.  Helps to remove
      artifacts left from previous displays when glyphless characters
      are displayed as hex code in a box.
      * src/xterm.c (x_draw_glyph_string_background): Force redraw of
      glyph string background also when the font in use claims
      preposterously large global height value.  Helps to remove
      artifacts left from previous displays when glyphless characters
      are displayed as hex code in a box.
      * src/w32font.c (w32font_draw): Fix background drawing for
      glyphless characters that display as acronyms or hex codes in a
      box.
      * src/xftfont.c (xftfont_draw): Fix background drawing for
      glyphless characters that display as acronyms or hex codes in a
      box.
      * src/xdisp.c (produce_glyphless_glyph): Compute reasonable values
      for it->ascent and it->descent when the font claims preposterously
      large global values.
      (FONT_TOO_HIGH): Move from here...
      * src/dispextern.h (FONT_TOO_HIGH): ...to here.
      c76605fa
  32. 26 May, 2015 1 commit
    • Eli Zaretskii's avatar
      Teach MS-Windows font back-end return per-glyph ascent/descent · 53bedd3a
      Eli Zaretskii authored
      * src/w32font.h (struct w32_metric_cache): Add ascent and descent
      values.
      
      * src/w32font.c (w32font_text_extents): Compute, cache, and
      accumulate per-glyph ascent and descent values, instead of copying
      global values from the font.  If the values are not available from
      the font data, i.e., non-TTF fonts, fall back on font-global values.
      (compute_metrics): Compute and return per-glyph ascent and descent
      values, if returned by GetGlyphOutlineW, falling back on
      font-global values.  (Bug#20628)
      
      * src/w32term.c (w32_draw_rectangle): Add 1 pixel to width and
      height of rectangle to be drawn, to be compatible with
      XDrawRectangle.  Fixes glyphless-char display as hex codes in a
      box, when per-glyph ascent/descent values are used.
      53bedd3a
  33. 20 May, 2015 1 commit
  34. 21 Feb, 2015 1 commit
  35. 11 Feb, 2015 1 commit
    • Martin Rudalics's avatar
      Improve toggling fullscreen state of frames. · 02138cb0
      Martin Rudalics authored
      * frame.el (toggle-frame-maximized, toggle-frame-fullscreen):
      Rename frame parameter `maximized' to `fullscreen-restore'.
      Restore fullwidth/-height after fullboth state.  Update
      doc-strings.
      * w32term.c (w32_read_socket): In SIZE_MAXIMIZED and
      SIZE_RESTORED cases correctly handle `maximized' value for the
      `fullscreen' parameter.  Don't use the 'maximized' parameter any
      more.
      (w32fullscreen_hook): Include menu bar height when calculating
      new text height in FULLSCREEN_BOTH case.
      * xterm.c (do_ewmh_fullscreen): Handle transition from
      FULLSCREEN_BOTH to FULLSCREEN_MAXIMIZED when
      x_frame_normalize_before_maximize is set.
      * frames.texi (Size Parameters): Update description of
      fullscreen frame parameter.
      02138cb0
  36. 07 Feb, 2015 1 commit
    • Martin Rudalics's avatar
      Try to improve handling of fullwidth/-height frames. · d1655783
      Martin Rudalics authored
      * 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.
      d1655783
  37. 25 Jan, 2015 1 commit
    • Eli Zaretskii's avatar
      Use bool for boolean in w32term.c · 03a20dc9
      Eli Zaretskii authored
       src/w32term.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_draw_glyphless_glyph_string_foreground)
       (x_draw_image_glyph_string, x_draw_glyph_string)
       (x_draw_stretch_glyph_string, note_mouse_movement)
       (w32_mouse_position, x_scroll_bar_report_motion)
       (x_horizontal_scroll_bar_report_motion, w32_read_socket)
       (w32_set_vertical_scroll_bar, w32_set_horizontal_scroll_bar)
       (w32_draw_window_cursor, x_new_font, x_set_offset)
       (x_set_window_size, x_make_frame_invisible, x_iconify_frame): Use
       bool where appropriate.
      03a20dc9
  38. 10 Jan, 2015 1 commit
    • Eli Zaretskii's avatar
      MS-Windows followup for change in semantics of XIL and XLI. (Bug#15880) · 485763c0
      Eli Zaretskii authored
       src/w32fns.c (Fw32_register_hot_key): Use XINT instead of XLI.
       src/w32notify.c (Fw32notify_add_watch, w32_get_watch_object): Use
       make_pointer_integer instead of XIL.
       (Fw32notify_rm_watch): Use XINTPTR instead of XLI.
       src/w32inevt.c (handle_file_notifications): Use make_pointer_integer
       instead of XIL.  Put a list of the descriptor, action, and file
       name in event->arg, instead of spreading them between event->code
       and event->arg.
       src/w32term.c (queue_notifications): Use make_pointer_integer
       instead of XIL.  Put a list of the descriptor, action, and file
       name in event->arg, instead of spreading them between event->code
       and event->arg.
       src/keyboard.c (kbd_buffer_get_event) [HAVE_W32NOTIFY]: Adjust Lisp
       event creation to changes in w32term.c and w32inevt.c above.
      485763c0