X-Git-Url: https://code.delx.au/gnu-emacs/blobdiff_plain/1c7b6b3e0a8e6fe5c8a476b2c45c4b61c609bdfe..23ffeb9015ca3669995b9a5d47cfc09b7643d9b9:/src/w32fns.c diff --git a/src/w32fns.c b/src/w32fns.c index 1b290b7919..789a91a3c9 100644 --- a/src/w32fns.c +++ b/src/w32fns.c @@ -1,6 +1,6 @@ /* Graphical user interface functions for the Microsoft Windows API. -Copyright (C) 1989, 1992-2014 Free Software Foundation, Inc. +Copyright (C) 1989, 1992-2015 Free Software Foundation, Inc. This file is part of GNU Emacs. @@ -93,19 +93,6 @@ extern char * w32_strerror (int error_no); #define IDC_HAND MAKEINTRESOURCE(32649) #endif -Lisp_Object Qundefined_color; -Lisp_Object Qcancel_timer; -Lisp_Object Qfont_param; -Lisp_Object Qhyper; -Lisp_Object Qsuper; -Lisp_Object Qmeta; -Lisp_Object Qalt; -Lisp_Object Qctrl; -Lisp_Object Qcontrol; -Lisp_Object Qshift; -static Lisp_Object Qgeometry, Qworkarea, Qmm_size, Qframes; - - /* Prefix for system colors. */ #define SYSTEM_COLOR_PREFIX "System" #define SYSTEM_COLOR_PREFIX_LEN (sizeof (SYSTEM_COLOR_PREFIX) - 1) @@ -1721,15 +1708,7 @@ x_set_tool_bar_lines (struct frame *f, Lisp_Object value, Lisp_Object oldval) else nlines = 0; - if (nlines == 0) - x_change_tool_bar_height (f, nlines * FRAME_LINE_HEIGHT (f)); - else - { - f->n_tool_bar_rows = 0; - FRAME_TOOL_BAR_LINES (f) = nlines; - adjust_frame_glyphs (f); - SET_FRAME_GARBAGED (f); - } + x_change_tool_bar_height (f, nlines * FRAME_LINE_HEIGHT (f)); } @@ -1749,11 +1728,7 @@ x_change_tool_bar_height (struct frame *f, int height) /* Recalculate tool bar and frame text sizes. */ FRAME_TOOL_BAR_HEIGHT (f) = height; FRAME_TOOL_BAR_LINES (f) = lines; -/** FRAME_TEXT_HEIGHT (f) **/ -/** = FRAME_PIXEL_TO_TEXT_HEIGHT (f, FRAME_PIXEL_HEIGHT (f)); **/ -/** FRAME_LINES (f) **/ -/** = FRAME_PIXEL_HEIGHT_TO_TEXT_LINES (f, FRAME_PIXEL_HEIGHT (f)); **/ - /* Store the `tool-bar-lines' and `height' frame parameters. */ + /* Store `tool-bar-lines' and `height' frame parameters. */ store_frame_param (f, Qtool_bar_lines, make_number (lines)); store_frame_param (f, Qheight, make_number (FRAME_LINES (f))); @@ -1772,6 +1747,10 @@ x_change_tool_bar_height (struct frame *f, int height) adjust_frame_size (f, -1, -1, (old_height == 0 || height == 0) ? 2 : 4, 0, Qtool_bar_lines); + /* adjust_frame_size might not have done anything, garbage frame + here. */ + adjust_frame_glyphs (f); + SET_FRAME_GARBAGED (f); if (FRAME_X_WINDOW (f)) x_clear_under_internal_border (f); } @@ -6149,7 +6128,7 @@ Text larger than the specified size is clipped. */) place the cursor there. Don't include the width of this glyph. */ last = &row->glyphs[TEXT_AREA][row->used[TEXT_AREA] - 1]; - if (INTEGERP (last->object)) + if (NILP (last->object)) row_width -= last->pixel_width; } else @@ -6159,7 +6138,7 @@ Text larger than the specified size is clipped. */) Don't count that glyph. */ struct glyph *g = row->glyphs[TEXT_AREA]; - if (g->type == STRETCH_GLYPH && INTEGERP (g->object)) + if (g->type == STRETCH_GLYPH && NILP (g->object)) { row_width -= g->pixel_width; seen_reversed_p = 1; @@ -6208,7 +6187,7 @@ Text larger than the specified size is clipped. */) if (row->used[TEXT_AREA] && !row->reversed_p) { last = &row->glyphs[TEXT_AREA][row->used[TEXT_AREA] - 1]; - if (INTEGERP (last->object)) + if (NILP (last->object)) row_width -= last->pixel_width; } @@ -6260,8 +6239,8 @@ Text larger than the specified size is clipped. */) } /* Draw into the window. */ - w->must_be_updated_p = 1; - update_single_window (w, 1); + w->must_be_updated_p = true; + update_single_window (w); unblock_input (); @@ -7019,7 +6998,14 @@ a ShowWindow flag: Lisp_Object absdoc_encoded = ENCODE_FILE (absdoc); if (faccessat (AT_FDCWD, SSDATA (absdoc_encoded), F_OK, AT_EACCESS) == 0) - document = absdoc_encoded; + { + /* ShellExecute fails if DOCUMENT is a UNC with forward + slashes (expand-file-name above converts all backslashes + to forward slashes). Now that we know DOCUMENT is a + file, we can mirror all forward slashes into backslashes. */ + unixtodos_filename (SSDATA (absdoc_encoded)); + document = absdoc_encoded; + } else document = ENCODE_FILE (document); } @@ -7249,7 +7235,7 @@ The return value is the hotkey-id if registered, otherwise nil. */) /* Notify input thread about new hot-key definition, so that it takes effect without needing to switch focus. */ PostThreadMessage (dwWindowsThreadId, WM_EMACS_REGISTER_HOT_KEY, - (WPARAM) XLI (key), 0); + (WPARAM) XINT (key), 0); } return key;