diff options
| author | Jason Rumney | 2001-11-22 20:44:11 +0000 |
|---|---|---|
| committer | Jason Rumney | 2001-11-22 20:44:11 +0000 |
| commit | ca56d9532d439b463b031d3b07001d8913550be1 (patch) | |
| tree | 8c9a042b162410ceaad83068d63ede7dd809ef1a /src | |
| parent | 7743d0332f7fa9e3e9303253cafa57fb920e4709 (diff) | |
| download | emacs-ca56d9532d439b463b031d3b07001d8913550be1.tar.gz emacs-ca56d9532d439b463b031d3b07001d8913550be1.zip | |
(x_window_to_frame): Remove irrelevant TODO comment.
(w32_wnd_proc) <WM_MENUSELECT>: Show help echo directly.
(my_create_tip_window): New function.
(x_create_tip_frame, compute_tip_xy): Adapt for Windows.
(Fx_show_tip, Fx_hide_tip) [TEST_TOOLTIPS]: Adapt for Windows.
Diffstat (limited to 'src')
| -rw-r--r-- | src/ChangeLog | 8 | ||||
| -rw-r--r-- | src/w32fns.c | 177 |
2 files changed, 108 insertions, 77 deletions
diff --git a/src/ChangeLog b/src/ChangeLog index 72845845628..bbf738bf5bb 100644 --- a/src/ChangeLog +++ b/src/ChangeLog | |||
| @@ -1,3 +1,11 @@ | |||
| 1 | 2001-11-22 Jason Rumney <jasonr@gnu.org> | ||
| 2 | |||
| 3 | * w32fns.c (x_window_to_frame): Remove irrelevant TODO comment. | ||
| 4 | (w32_wnd_proc) <WM_MENUSELECT>: Show help echo directly. | ||
| 5 | (my_create_tip_window): New function. | ||
| 6 | (x_create_tip_frame, compute_tip_xy): Adapt for Windows. | ||
| 7 | (Fx_show_tip, Fx_hide_tip) [TEST_TOOLTIPS]: Adapt for Windows. | ||
| 8 | |||
| 1 | 2001-11-20 Jason Rumney <jasonr@gnu.org> | 9 | 2001-11-20 Jason Rumney <jasonr@gnu.org> |
| 2 | 10 | ||
| 3 | * coding.h (Vw32_system_coding_system) [WINDOWSNT]: Remove. | 11 | * coding.h (Vw32_system_coding_system) [WINDOWSNT]: Remove. |
diff --git a/src/w32fns.c b/src/w32fns.c index ad19fff32d4..c5966149f4f 100644 --- a/src/w32fns.c +++ b/src/w32fns.c | |||
| @@ -400,7 +400,6 @@ x_window_to_frame (dpyinfo, wdesc) | |||
| 400 | if (f->output_data.w32->hourglass_window == wdesc) | 400 | if (f->output_data.w32->hourglass_window == wdesc) |
| 401 | return f; | 401 | return f; |
| 402 | 402 | ||
| 403 | /* TODO: Check tooltips when supported. */ | ||
| 404 | if (FRAME_W32_WINDOW (f) == wdesc) | 403 | if (FRAME_W32_WINDOW (f) == wdesc) |
| 405 | return f; | 404 | return f; |
| 406 | } | 405 | } |
| @@ -660,6 +659,8 @@ struct x_frame_parm_table | |||
| 660 | void (*setter) P_ ((struct frame *, Lisp_Object, Lisp_Object)); | 659 | void (*setter) P_ ((struct frame *, Lisp_Object, Lisp_Object)); |
| 661 | }; | 660 | }; |
| 662 | 661 | ||
| 662 | BOOL my_show_window P_ ((struct frame *, HWND, int)); | ||
| 663 | void my_set_window_pos P_ ((HWND, HWND, int, int, int, int, UINT)); | ||
| 663 | static Lisp_Object unwind_create_frame P_ ((Lisp_Object)); | 664 | static Lisp_Object unwind_create_frame P_ ((Lisp_Object)); |
| 664 | static Lisp_Object unwind_create_tip_frame P_ ((Lisp_Object)); | 665 | static Lisp_Object unwind_create_tip_frame P_ ((Lisp_Object)); |
| 665 | static void x_change_window_heights P_ ((Lisp_Object, int)); | 666 | static void x_change_window_heights P_ ((Lisp_Object, int)); |
| @@ -4685,8 +4686,23 @@ w32_wnd_proc (hwnd, msg, wParam, lParam) | |||
| 4685 | goto dflt; | 4686 | goto dflt; |
| 4686 | 4687 | ||
| 4687 | case WM_MENUSELECT: | 4688 | case WM_MENUSELECT: |
| 4689 | #if OLD_MENU_HELP | ||
| 4688 | wmsg.dwModifiers = w32_get_modifiers (); | 4690 | wmsg.dwModifiers = w32_get_modifiers (); |
| 4689 | my_post_msg (&wmsg, hwnd, msg, wParam, lParam); | 4691 | my_post_msg (&wmsg, hwnd, msg, wParam, lParam); |
| 4692 | #else | ||
| 4693 | { | ||
| 4694 | /* Try to process these directly: the relevant parts of redisplay | ||
| 4695 | are supposed to be re-entrant now. This should allow tooltips | ||
| 4696 | to be shown for menus. */ | ||
| 4697 | HMENU menu = (HMENU) lParam; | ||
| 4698 | UINT menu_item = (UINT) LOWORD (wParam); | ||
| 4699 | UINT flags = (UINT) HIWORD (wParam); | ||
| 4700 | |||
| 4701 | BLOCK_INPUT; | ||
| 4702 | w32_menu_display_help (menu, menu_item, flags); | ||
| 4703 | UNBLOCK_INPUT; | ||
| 4704 | } | ||
| 4705 | #endif | ||
| 4690 | return 0; | 4706 | return 0; |
| 4691 | 4707 | ||
| 4692 | case WM_MEASUREITEM: | 4708 | case WM_MEASUREITEM: |
| @@ -5037,6 +5053,43 @@ my_create_window (f) | |||
| 5037 | GetMessage (&msg, NULL, WM_EMACS_DONE, WM_EMACS_DONE); | 5053 | GetMessage (&msg, NULL, WM_EMACS_DONE, WM_EMACS_DONE); |
| 5038 | } | 5054 | } |
| 5039 | 5055 | ||
| 5056 | |||
| 5057 | /* Create a tooltip window. Unlike my_create_window, we do not do this | ||
| 5058 | indirectly via the Window thread, as we do not need to process Window | ||
| 5059 | messages for the tooltip. Creating tooltips indirectly also creates | ||
| 5060 | deadlocks when tooltips are created for menu items. */ | ||
| 5061 | void | ||
| 5062 | my_create_tip_window (f) | ||
| 5063 | struct frame *f; | ||
| 5064 | { | ||
| 5065 | HWND hwnd; | ||
| 5066 | |||
| 5067 | FRAME_W32_WINDOW (f) = hwnd | ||
| 5068 | = CreateWindow (EMACS_CLASS, | ||
| 5069 | f->namebuf, | ||
| 5070 | f->output_data.w32->dwStyle, | ||
| 5071 | f->output_data.w32->left_pos, | ||
| 5072 | f->output_data.w32->top_pos, | ||
| 5073 | PIXEL_WIDTH (f), | ||
| 5074 | PIXEL_HEIGHT (f), | ||
| 5075 | FRAME_W32_WINDOW (SELECTED_FRAME ()), /* owner */ | ||
| 5076 | NULL, | ||
| 5077 | hinst, | ||
| 5078 | NULL); | ||
| 5079 | |||
| 5080 | if (hwnd) | ||
| 5081 | { | ||
| 5082 | SetWindowLong (hwnd, WND_FONTWIDTH_INDEX, FONT_WIDTH (f->output_data.w32->font)); | ||
| 5083 | SetWindowLong (hwnd, WND_LINEHEIGHT_INDEX, f->output_data.w32->line_height); | ||
| 5084 | SetWindowLong (hwnd, WND_BORDER_INDEX, f->output_data.w32->internal_border_width); | ||
| 5085 | SetWindowLong (hwnd, WND_BACKGROUND_INDEX, FRAME_BACKGROUND_PIXEL (f)); | ||
| 5086 | |||
| 5087 | /* Do this to discard the default setting specified by our parent. */ | ||
| 5088 | ShowWindow (hwnd, SW_HIDE); | ||
| 5089 | } | ||
| 5090 | } | ||
| 5091 | |||
| 5092 | |||
| 5040 | /* Create and set up the w32 window for frame F. */ | 5093 | /* Create and set up the w32 window for frame F. */ |
| 5041 | 5094 | ||
| 5042 | static void | 5095 | static void |
| @@ -13014,7 +13067,6 @@ x_create_tip_frame (dpyinfo, parms, text) | |||
| 13014 | struct w32_display_info *dpyinfo; | 13067 | struct w32_display_info *dpyinfo; |
| 13015 | Lisp_Object parms, text; | 13068 | Lisp_Object parms, text; |
| 13016 | { | 13069 | { |
| 13017 | #if 0 /* TODO : w32 version */ | ||
| 13018 | struct frame *f; | 13070 | struct frame *f; |
| 13019 | Lisp_Object frame, tem; | 13071 | Lisp_Object frame, tem; |
| 13020 | Lisp_Object name; | 13072 | Lisp_Object name; |
| @@ -13027,7 +13079,7 @@ x_create_tip_frame (dpyinfo, parms, text) | |||
| 13027 | Lisp_Object buffer; | 13079 | Lisp_Object buffer; |
| 13028 | struct buffer *old_buffer; | 13080 | struct buffer *old_buffer; |
| 13029 | 13081 | ||
| 13030 | check_x (); | 13082 | check_w32 (); |
| 13031 | 13083 | ||
| 13032 | /* Use this general default value to start with until we know if | 13084 | /* Use this general default value to start with until we know if |
| 13033 | this frame has a specified name. */ | 13085 | this frame has a specified name. */ |
| @@ -13072,13 +13124,11 @@ x_create_tip_frame (dpyinfo, parms, text) | |||
| 13072 | f->output_data.w32 = | 13124 | f->output_data.w32 = |
| 13073 | (struct w32_output *) xmalloc (sizeof (struct w32_output)); | 13125 | (struct w32_output *) xmalloc (sizeof (struct w32_output)); |
| 13074 | bzero (f->output_data.w32, sizeof (struct w32_output)); | 13126 | bzero (f->output_data.w32, sizeof (struct w32_output)); |
| 13075 | #if 0 | 13127 | |
| 13076 | f->output_data.w32->icon_bitmap = -1; | 13128 | FRAME_FONTSET (f) = -1; |
| 13077 | #endif | ||
| 13078 | f->output_data.w32->fontset = -1; | ||
| 13079 | f->icon_name = Qnil; | 13129 | f->icon_name = Qnil; |
| 13080 | 13130 | ||
| 13081 | #ifdef GLYPH_DEBUG | 13131 | #if 0 /* GLYPH_DEBUG TODO: image support. */ |
| 13082 | image_cache_refcount = FRAME_X_IMAGE_CACHE (f)->refcount; | 13132 | image_cache_refcount = FRAME_X_IMAGE_CACHE (f)->refcount; |
| 13083 | dpyinfo_refcount = dpyinfo->reference_count; | 13133 | dpyinfo_refcount = dpyinfo->reference_count; |
| 13084 | #endif /* GLYPH_DEBUG */ | 13134 | #endif /* GLYPH_DEBUG */ |
| @@ -13092,7 +13142,7 @@ x_create_tip_frame (dpyinfo, parms, text) | |||
| 13092 | be set. */ | 13142 | be set. */ |
| 13093 | if (EQ (name, Qunbound) || NILP (name)) | 13143 | if (EQ (name, Qunbound) || NILP (name)) |
| 13094 | { | 13144 | { |
| 13095 | f->name = build_string (dpyinfo->x_id_name); | 13145 | f->name = build_string (dpyinfo->w32_id_name); |
| 13096 | f->explicit_name = 0; | 13146 | f->explicit_name = 0; |
| 13097 | } | 13147 | } |
| 13098 | else | 13148 | else |
| @@ -13123,21 +13173,15 @@ x_create_tip_frame (dpyinfo, parms, text) | |||
| 13123 | 13173 | ||
| 13124 | /* Try out a font which we hope has bold and italic variations. */ | 13174 | /* Try out a font which we hope has bold and italic variations. */ |
| 13125 | if (!STRINGP (font)) | 13175 | if (!STRINGP (font)) |
| 13126 | font = x_new_font (f, "-*-courier new-normal-r-*-*-*-100-*-*-*-*-iso8859-1"); | 13176 | font = x_new_font (f, "-*-Courier New-normal-r-*-*-*-100-*-*-c-*-iso8859-1"); |
| 13127 | if (!STRINGP (font)) | ||
| 13128 | font = x_new_font (f, "-misc-fixed-medium-r-normal-*-*-140-*-*-c-*-iso8859-1"); | ||
| 13129 | if (! STRINGP (font)) | ||
| 13130 | font = x_new_font (f, "-*-*-medium-r-normal-*-*-140-*-*-c-*-iso8859-1"); | ||
| 13131 | if (! STRINGP (font)) | 13177 | if (! STRINGP (font)) |
| 13132 | /* This was formerly the first thing tried, but it finds too many fonts | 13178 | font = x_new_font (f, "-*-Courier-normal-r-*-*-13-*-*-*-c-*-iso8859-1"); |
| 13133 | and takes too long. */ | ||
| 13134 | font = x_new_font (f, "-*-*-medium-r-*-*-*-*-*-*-c-*-iso8859-1"); | ||
| 13135 | /* If those didn't work, look for something which will at least work. */ | 13179 | /* If those didn't work, look for something which will at least work. */ |
| 13136 | if (! STRINGP (font)) | 13180 | if (! STRINGP (font)) |
| 13137 | font = x_new_font (f, "-*-fixed-*-*-*-*-*-140-*-*-c-*-iso8859-1"); | 13181 | font = x_new_font (f, "-*-Fixedsys-normal-r-*-*-12-*-*-*-c-*-iso8859-1"); |
| 13138 | UNBLOCK_INPUT; | 13182 | UNBLOCK_INPUT; |
| 13139 | if (! STRINGP (font)) | 13183 | if (! STRINGP (font)) |
| 13140 | font = build_string ("fixed"); | 13184 | font = build_string ("Fixedsys"); |
| 13141 | 13185 | ||
| 13142 | x_default_parameter (f, parms, Qfont, font, | 13186 | x_default_parameter (f, parms, Qfont, font, |
| 13143 | "font", "Font", RES_TYPE_STRING); | 13187 | "font", "Font", RES_TYPE_STRING); |
| @@ -13145,7 +13189,6 @@ x_create_tip_frame (dpyinfo, parms, text) | |||
| 13145 | 13189 | ||
| 13146 | x_default_parameter (f, parms, Qborder_width, make_number (2), | 13190 | x_default_parameter (f, parms, Qborder_width, make_number (2), |
| 13147 | "borderWidth", "BorderWidth", RES_TYPE_NUMBER); | 13191 | "borderWidth", "BorderWidth", RES_TYPE_NUMBER); |
| 13148 | |||
| 13149 | /* This defaults to 2 in order to match xterm. We recognize either | 13192 | /* This defaults to 2 in order to match xterm. We recognize either |
| 13150 | internalBorderWidth or internalBorder (which is what xterm calls | 13193 | internalBorderWidth or internalBorder (which is what xterm calls |
| 13151 | it). */ | 13194 | it). */ |
| @@ -13159,8 +13202,9 @@ x_create_tip_frame (dpyinfo, parms, text) | |||
| 13159 | parms = Fcons (Fcons (Qinternal_border_width, value), | 13202 | parms = Fcons (Fcons (Qinternal_border_width, value), |
| 13160 | parms); | 13203 | parms); |
| 13161 | } | 13204 | } |
| 13162 | 13205 | /* Default internalBorderWidth for tooltips to 2 on Windows to match | |
| 13163 | x_default_parameter (f, parms, Qinternal_border_width, make_number (1), | 13206 | other programs. */ |
| 13207 | x_default_parameter (f, parms, Qinternal_border_width, make_number (2), | ||
| 13164 | "internalBorderWidth", "internalBorderWidth", | 13208 | "internalBorderWidth", "internalBorderWidth", |
| 13165 | RES_TYPE_NUMBER); | 13209 | RES_TYPE_NUMBER); |
| 13166 | 13210 | ||
| @@ -13183,7 +13227,8 @@ x_create_tip_frame (dpyinfo, parms, text) | |||
| 13183 | end up in init_iterator with a null face cache, which should not | 13227 | end up in init_iterator with a null face cache, which should not |
| 13184 | happen. */ | 13228 | happen. */ |
| 13185 | init_frame_faces (f); | 13229 | init_frame_faces (f); |
| 13186 | 13230 | ||
| 13231 | f->output_data.w32->dwStyle = WS_BORDER | WS_POPUP | WS_DISABLED; | ||
| 13187 | f->output_data.w32->parent_desc = FRAME_W32_DISPLAY_INFO (f)->root_window; | 13232 | f->output_data.w32->parent_desc = FRAME_W32_DISPLAY_INFO (f)->root_window; |
| 13188 | window_prompting = x_figure_window_size (f, parms); | 13233 | window_prompting = x_figure_window_size (f, parms); |
| 13189 | 13234 | ||
| @@ -13203,35 +13248,10 @@ x_create_tip_frame (dpyinfo, parms, text) | |||
| 13203 | } | 13248 | } |
| 13204 | 13249 | ||
| 13205 | f->output_data.w32->size_hint_flags = window_prompting; | 13250 | f->output_data.w32->size_hint_flags = window_prompting; |
| 13206 | { | 13251 | |
| 13207 | XSetWindowAttributes attrs; | 13252 | BLOCK_INPUT; |
| 13208 | unsigned long mask; | 13253 | my_create_tip_window (f); |
| 13209 | 13254 | UNBLOCK_INPUT; | |
| 13210 | BLOCK_INPUT; | ||
| 13211 | mask = CWBackPixel | CWOverrideRedirect | CWEventMask; | ||
| 13212 | if (DoesSaveUnders (dpyinfo->screen)) | ||
| 13213 | mask |= CWSaveUnder; | ||
| 13214 | |||
| 13215 | /* Window managers looks at the override-redirect flag to | ||
| 13216 | determine whether or net to give windows a decoration (Xlib | ||
| 13217 | 3.2.8). */ | ||
| 13218 | attrs.override_redirect = True; | ||
| 13219 | attrs.save_under = True; | ||
| 13220 | attrs.background_pixel = FRAME_BACKGROUND_PIXEL (f); | ||
| 13221 | /* Arrange for getting MapNotify and UnmapNotify events. */ | ||
| 13222 | attrs.event_mask = StructureNotifyMask; | ||
| 13223 | tip_window | ||
| 13224 | = FRAME_W32_WINDOW (f) | ||
| 13225 | = XCreateWindow (FRAME_W32_DISPLAY (f), | ||
| 13226 | FRAME_W32_DISPLAY_INFO (f)->root_window, | ||
| 13227 | /* x, y, width, height */ | ||
| 13228 | 0, 0, 1, 1, | ||
| 13229 | /* Border. */ | ||
| 13230 | 1, | ||
| 13231 | CopyFromParent, InputOutput, CopyFromParent, | ||
| 13232 | mask, &attrs); | ||
| 13233 | UNBLOCK_INPUT; | ||
| 13234 | } | ||
| 13235 | 13255 | ||
| 13236 | x_make_gc (f); | 13256 | x_make_gc (f); |
| 13237 | 13257 | ||
| @@ -13293,8 +13313,6 @@ x_create_tip_frame (dpyinfo, parms, text) | |||
| 13293 | 13313 | ||
| 13294 | /* Discard the unwind_protect. */ | 13314 | /* Discard the unwind_protect. */ |
| 13295 | return unbind_to (count, frame); | 13315 | return unbind_to (count, frame); |
| 13296 | #endif /* TODO */ | ||
| 13297 | return Qnil; | ||
| 13298 | } | 13316 | } |
| 13299 | 13317 | ||
| 13300 | 13318 | ||
| @@ -13311,10 +13329,7 @@ compute_tip_xy (f, parms, dx, dy, width, height, root_x, root_y) | |||
| 13311 | int width, height; | 13329 | int width, height; |
| 13312 | int *root_x, *root_y; | 13330 | int *root_x, *root_y; |
| 13313 | { | 13331 | { |
| 13314 | #ifdef TODO /* Tool tips not supported. */ | ||
| 13315 | Lisp_Object left, top; | 13332 | Lisp_Object left, top; |
| 13316 | int win_x, win_y; | ||
| 13317 | Window root, child; | ||
| 13318 | unsigned pmask; | 13333 | unsigned pmask; |
| 13319 | 13334 | ||
| 13320 | /* User-specified position? */ | 13335 | /* User-specified position? */ |
| @@ -13323,11 +13338,14 @@ compute_tip_xy (f, parms, dx, dy, width, height, root_x, root_y) | |||
| 13323 | 13338 | ||
| 13324 | /* Move the tooltip window where the mouse pointer is. Resize and | 13339 | /* Move the tooltip window where the mouse pointer is. Resize and |
| 13325 | show it. */ | 13340 | show it. */ |
| 13326 | if (!INTEGERP (left) && !INTEGERP (top)) | 13341 | if (!INTEGERP (left) || !INTEGERP (top)) |
| 13327 | { | 13342 | { |
| 13343 | POINT pt; | ||
| 13344 | |||
| 13328 | BLOCK_INPUT; | 13345 | BLOCK_INPUT; |
| 13329 | XQueryPointer (FRAME_X_DISPLAY (f), FRAME_X_DISPLAY_INFO (f)->root_window, | 13346 | GetCursorPos (&pt); |
| 13330 | &root, &child, root_x, root_y, &win_x, &win_y, &pmask); | 13347 | *root_x = pt.x; |
| 13348 | *root_y = pt.y; | ||
| 13331 | UNBLOCK_INPUT; | 13349 | UNBLOCK_INPUT; |
| 13332 | } | 13350 | } |
| 13333 | 13351 | ||
| @@ -13343,16 +13361,14 @@ compute_tip_xy (f, parms, dx, dy, width, height, root_x, root_y) | |||
| 13343 | 13361 | ||
| 13344 | if (INTEGERP (left)) | 13362 | if (INTEGERP (left)) |
| 13345 | *root_x = XINT (left); | 13363 | *root_x = XINT (left); |
| 13346 | else if (*root_x + XINT (dx) + width > FRAME_X_DISPLAY_INFO (f)->width) | 13364 | else if (*root_x + XINT (dx) + width > FRAME_WIDTH (f)) |
| 13347 | *root_x -= width + XINT (dx); | 13365 | *root_x -= width + XINT (dx); |
| 13348 | else | 13366 | else |
| 13349 | *root_x += XINT (dx); | 13367 | *root_x += XINT (dx); |
| 13350 | |||
| 13351 | #endif /* Tooltip support. */ | ||
| 13352 | } | 13368 | } |
| 13353 | 13369 | ||
| 13354 | 13370 | ||
| 13355 | #ifdef TODO /* Tooltip support not complete. */ | 13371 | #ifdef TEST_TOOLTIPS /* Tooltip support in progress. */ |
| 13356 | DEFUN ("x-show-tip", Fx_show_tip, Sx_show_tip, 1, 6, 0, | 13372 | DEFUN ("x-show-tip", Fx_show_tip, Sx_show_tip, 1, 6, 0, |
| 13357 | doc: /* Show STRING in a \"tooltip\" window on frame FRAME. | 13373 | doc: /* Show STRING in a \"tooltip\" window on frame FRAME. |
| 13358 | A tooltip window is a small window displaying a string. | 13374 | A tooltip window is a small window displaying a string. |
| @@ -13362,10 +13378,10 @@ FRAME nil or omitted means use the selected frame. | |||
| 13362 | PARMS is an optional list of frame parameters which can be | 13378 | PARMS is an optional list of frame parameters which can be |
| 13363 | used to change the tooltip's appearance. | 13379 | used to change the tooltip's appearance. |
| 13364 | 13380 | ||
| 13365 | Automatically hide the tooltip after TIMEOUT seconds. | 13381 | Automatically hide the tooltip after TIMEOUT seconds. TIMEOUT nil |
| 13366 | TIMEOUT nil means use the default timeout of 5 seconds. | 13382 | means use the default timeout of 5 seconds. |
| 13367 | 13383 | ||
| 13368 | If the list of frame parameters PARAMS contains a `left' parameters, | 13384 | If the list of frame parameters PARAMS contains a `left' parameter, |
| 13369 | the tooltip is displayed at that x-position. Otherwise it is | 13385 | the tooltip is displayed at that x-position. Otherwise it is |
| 13370 | displayed at the mouse position, with offset DX added (default is 5 if | 13386 | displayed at the mouse position, with offset DX added (default is 5 if |
| 13371 | DX isn't specified). Likewise for the y-position; if a `top' frame | 13387 | DX isn't specified). Likewise for the y-position; if a `top' frame |
| @@ -13386,7 +13402,7 @@ Text larger than the specified size is clipped. */) | |||
| 13386 | int i, width, height; | 13402 | int i, width, height; |
| 13387 | struct gcpro gcpro1, gcpro2, gcpro3, gcpro4; | 13403 | struct gcpro gcpro1, gcpro2, gcpro3, gcpro4; |
| 13388 | int old_windows_or_buffers_changed = windows_or_buffers_changed; | 13404 | int old_windows_or_buffers_changed = windows_or_buffers_changed; |
| 13389 | int count = specpdl_ptr - specpdl; | 13405 | int count = BINDING_STACK_SIZE (); |
| 13390 | 13406 | ||
| 13391 | specbind (Qinhibit_redisplay, Qt); | 13407 | specbind (Qinhibit_redisplay, Qt); |
| 13392 | 13408 | ||
| @@ -13433,9 +13449,11 @@ Text larger than the specified size is clipped. */) | |||
| 13433 | } | 13449 | } |
| 13434 | 13450 | ||
| 13435 | BLOCK_INPUT; | 13451 | BLOCK_INPUT; |
| 13436 | compute_tip_xy (f, parms, dx, dy, &root_x, &root_y); | 13452 | compute_tip_xy (f, parms, dx, dy, PIXEL_WIDTH (f), |
| 13437 | XMoveWindow (FRAME_X_DISPLAY (f), FRAME_X_WINDOW (f), | 13453 | PIXEL_HEIGHT (f), &root_x, &root_y); |
| 13438 | root_x, root_y - PIXEL_HEIGHT (f)); | 13454 | SetWindowPos (FRAME_W32_WINDOW (f), HWND_TOPMOST, |
| 13455 | root_x, root_y, 0, 0, | ||
| 13456 | SWP_NOSIZE | SWP_NOACTIVATE); | ||
| 13439 | UNBLOCK_INPUT; | 13457 | UNBLOCK_INPUT; |
| 13440 | goto start_timer; | 13458 | goto start_timer; |
| 13441 | } | 13459 | } |
| @@ -13463,7 +13481,7 @@ Text larger than the specified size is clipped. */) | |||
| 13463 | 13481 | ||
| 13464 | /* Create a frame for the tooltip, and record it in the global | 13482 | /* Create a frame for the tooltip, and record it in the global |
| 13465 | variable tip_frame. */ | 13483 | variable tip_frame. */ |
| 13466 | frame = x_create_tip_frame (FRAME_W32_DISPLAY_INFO (f), parms); | 13484 | frame = x_create_tip_frame (FRAME_W32_DISPLAY_INFO (f), parms, string); |
| 13467 | f = XFRAME (frame); | 13485 | f = XFRAME (frame); |
| 13468 | 13486 | ||
| 13469 | /* Set up the frame's root window. */ | 13487 | /* Set up the frame's root window. */ |
| @@ -13523,7 +13541,8 @@ Text larger than the specified size is clipped. */) | |||
| 13523 | else | 13541 | else |
| 13524 | row_width = row->pixel_width; | 13542 | row_width = row->pixel_width; |
| 13525 | 13543 | ||
| 13526 | height += row->height; | 13544 | /* TODO: find why tips do not draw along baseline as instructed. */ |
| 13545 | height += row->height * 2; | ||
| 13527 | width = max (width, row_width); | 13546 | width = max (width, row_width); |
| 13528 | } | 13547 | } |
| 13529 | 13548 | ||
| @@ -13537,9 +13556,10 @@ Text larger than the specified size is clipped. */) | |||
| 13537 | compute_tip_xy (f, parms, dx, dy, width, height, &root_x, &root_y); | 13556 | compute_tip_xy (f, parms, dx, dy, width, height, &root_x, &root_y); |
| 13538 | 13557 | ||
| 13539 | BLOCK_INPUT; | 13558 | BLOCK_INPUT; |
| 13540 | XMoveResizeWindow (FRAME_X_DISPLAY (f), FRAME_X_WINDOW (f), | 13559 | SetWindowPos (FRAME_W32_WINDOW (f), HWND_TOPMOST, |
| 13541 | root_x, root_y - height, width, height); | 13560 | root_x, root_y - height, width, height, |
| 13542 | XMapRaised (FRAME_X_DISPLAY (f), FRAME_X_WINDOW (f)); | 13561 | SWP_NOACTIVATE); |
| 13562 | my_show_window (f, FRAME_W32_WINDOW (f), SW_SHOWNORMAL); | ||
| 13543 | UNBLOCK_INPUT; | 13563 | UNBLOCK_INPUT; |
| 13544 | 13564 | ||
| 13545 | /* Draw into the window. */ | 13565 | /* Draw into the window. */ |
| @@ -14706,7 +14726,7 @@ versions of Windows) characters. */); | |||
| 14706 | 14726 | ||
| 14707 | hourglass_atimer = NULL; | 14727 | hourglass_atimer = NULL; |
| 14708 | hourglass_shown_p = 0; | 14728 | hourglass_shown_p = 0; |
| 14709 | #ifdef TODO /* Tooltip support not complete. */ | 14729 | #if TEST_TOOLTIPS /* Tooltip support in progress. */ |
| 14710 | defsubr (&Sx_show_tip); | 14730 | defsubr (&Sx_show_tip); |
| 14711 | defsubr (&Sx_hide_tip); | 14731 | defsubr (&Sx_hide_tip); |
| 14712 | #endif | 14732 | #endif |
| @@ -14715,6 +14735,9 @@ versions of Windows) characters. */); | |||
| 14715 | tip_frame = Qnil; | 14735 | tip_frame = Qnil; |
| 14716 | staticpro (&tip_frame); | 14736 | staticpro (&tip_frame); |
| 14717 | 14737 | ||
| 14738 | last_show_tip_args = Qnil; | ||
| 14739 | staticpro (&last_show_tip_args); | ||
| 14740 | |||
| 14718 | defsubr (&Sx_file_dialog); | 14741 | defsubr (&Sx_file_dialog); |
| 14719 | } | 14742 | } |
| 14720 | 14743 | ||