aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJason Rumney2001-11-24 17:39:31 +0000
committerJason Rumney2001-11-24 17:39:31 +0000
commitbfd6edcc91305499f20688d0255955804e03f5a5 (patch)
tree163405ad61cdfeb4bb5f3f9eb4589c6b7d5789e7
parentb71b81116a0515b1e95d03565b0fe6d757feb845 (diff)
downloademacs-bfd6edcc91305499f20688d0255955804e03f5a5.tar.gz
emacs-bfd6edcc91305499f20688d0255955804e03f5a5.zip
(w32_wnd_proc) <WM_MENUSELECT>: Revert last change.
<WM_WINDOWPOSCHANGING>: Let tip frames resize without restriction. (my_create_tip_window, Fx_show_tip): Adjust size for external border. (my_create_tip_window): Assign tip_window. (x_create_tip_frame): Use same defaults as X. (compute_tip_xy): Remove unused variable. Use full screen width. (Fx_show_tip): Do not double height. Call ShowWindow directly.
-rw-r--r--src/w32fns.c78
1 files changed, 51 insertions, 27 deletions
diff --git a/src/w32fns.c b/src/w32fns.c
index c5966149f4f..0dedd61483d 100644
--- a/src/w32fns.c
+++ b/src/w32fns.c
@@ -4686,14 +4686,11 @@ w32_wnd_proc (hwnd, msg, wParam, lParam)
4686 goto dflt; 4686 goto dflt;
4687 4687
4688 case WM_MENUSELECT: 4688 case WM_MENUSELECT:
4689#if OLD_MENU_HELP 4689#if DIRECT_MENU_HELP
4690 wmsg.dwModifiers = w32_get_modifiers ();
4691 my_post_msg (&wmsg, hwnd, msg, wParam, lParam);
4692#else
4693 { 4690 {
4694 /* Try to process these directly: the relevant parts of redisplay 4691 /* Tooltips seemed to behave better when help_echo was directly
4695 are supposed to be re-entrant now. This should allow tooltips 4692 displayed, but this causes crashes when GC kicks in when the
4696 to be shown for menus. */ 4693 tip_frame is active. */
4697 HMENU menu = (HMENU) lParam; 4694 HMENU menu = (HMENU) lParam;
4698 UINT menu_item = (UINT) LOWORD (wParam); 4695 UINT menu_item = (UINT) LOWORD (wParam);
4699 UINT flags = (UINT) HIWORD (wParam); 4696 UINT flags = (UINT) HIWORD (wParam);
@@ -4702,6 +4699,9 @@ w32_wnd_proc (hwnd, msg, wParam, lParam)
4702 w32_menu_display_help (menu, menu_item, flags); 4699 w32_menu_display_help (menu, menu_item, flags);
4703 UNBLOCK_INPUT; 4700 UNBLOCK_INPUT;
4704 } 4701 }
4702#else
4703 wmsg.dwModifiers = w32_get_modifiers ();
4704 my_post_msg (&wmsg, hwnd, msg, wParam, lParam);
4705#endif 4705#endif
4706 return 0; 4706 return 0;
4707 4707
@@ -4835,6 +4835,9 @@ w32_wnd_proc (hwnd, msg, wParam, lParam)
4835 return 0; 4835 return 0;
4836 4836
4837 case WM_WINDOWPOSCHANGING: 4837 case WM_WINDOWPOSCHANGING:
4838 /* Don't restrict the sizing of tip frames. */
4839 if (hwnd == tip_window)
4840 return 0;
4838 { 4841 {
4839 WINDOWPLACEMENT wp; 4842 WINDOWPLACEMENT wp;
4840 LPWINDOWPOS lppos = (WINDOWPOS *) lParam; 4843 LPWINDOWPOS lppos = (WINDOWPOS *) lParam;
@@ -5062,30 +5065,40 @@ void
5062my_create_tip_window (f) 5065my_create_tip_window (f)
5063 struct frame *f; 5066 struct frame *f;
5064{ 5067{
5065 HWND hwnd; 5068 RECT rect;
5066 5069
5067 FRAME_W32_WINDOW (f) = hwnd 5070 rect.left = rect.top = 0;
5071 rect.right = PIXEL_WIDTH (f);
5072 rect.bottom = PIXEL_HEIGHT (f);
5073
5074 AdjustWindowRect (&rect, f->output_data.w32->dwStyle,
5075 FRAME_EXTERNAL_MENU_BAR (f));
5076
5077 tip_window = FRAME_W32_WINDOW (f)
5068 = CreateWindow (EMACS_CLASS, 5078 = CreateWindow (EMACS_CLASS,
5069 f->namebuf, 5079 f->namebuf,
5070 f->output_data.w32->dwStyle, 5080 f->output_data.w32->dwStyle,
5071 f->output_data.w32->left_pos, 5081 f->output_data.w32->left_pos,
5072 f->output_data.w32->top_pos, 5082 f->output_data.w32->top_pos,
5073 PIXEL_WIDTH (f), 5083 rect.right - rect.left,
5074 PIXEL_HEIGHT (f), 5084 rect.bottom - rect.top,
5075 FRAME_W32_WINDOW (SELECTED_FRAME ()), /* owner */ 5085 FRAME_W32_WINDOW (SELECTED_FRAME ()), /* owner */
5076 NULL, 5086 NULL,
5077 hinst, 5087 hinst,
5078 NULL); 5088 NULL);
5079 5089
5080 if (hwnd) 5090 if (tip_window)
5081 { 5091 {
5082 SetWindowLong (hwnd, WND_FONTWIDTH_INDEX, FONT_WIDTH (f->output_data.w32->font)); 5092 SetWindowLong (tip_window, WND_FONTWIDTH_INDEX, FONT_WIDTH (f->output_data.w32->font));
5083 SetWindowLong (hwnd, WND_LINEHEIGHT_INDEX, f->output_data.w32->line_height); 5093 SetWindowLong (tip_window, WND_LINEHEIGHT_INDEX, f->output_data.w32->line_height);
5084 SetWindowLong (hwnd, WND_BORDER_INDEX, f->output_data.w32->internal_border_width); 5094 SetWindowLong (tip_window, WND_BORDER_INDEX, f->output_data.w32->internal_border_width);
5085 SetWindowLong (hwnd, WND_BACKGROUND_INDEX, FRAME_BACKGROUND_PIXEL (f)); 5095 SetWindowLong (tip_window, WND_BACKGROUND_INDEX, FRAME_BACKGROUND_PIXEL (f));
5096
5097 /* Tip frames have no scrollbars. */
5098 SetWindowLong (tip_window, WND_SCROLLBAR_INDEX, 0);
5086 5099
5087 /* Do this to discard the default setting specified by our parent. */ 5100 /* Do this to discard the default setting specified by our parent. */
5088 ShowWindow (hwnd, SW_HIDE); 5101 ShowWindow (tip_window, SW_HIDE);
5089 } 5102 }
5090} 5103}
5091 5104
@@ -13202,9 +13215,7 @@ x_create_tip_frame (dpyinfo, parms, text)
13202 parms = Fcons (Fcons (Qinternal_border_width, value), 13215 parms = Fcons (Fcons (Qinternal_border_width, value),
13203 parms); 13216 parms);
13204 } 13217 }
13205 /* Default internalBorderWidth for tooltips to 2 on Windows to match 13218 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),
13208 "internalBorderWidth", "internalBorderWidth", 13219 "internalBorderWidth", "internalBorderWidth",
13209 RES_TYPE_NUMBER); 13220 RES_TYPE_NUMBER);
13210 13221
@@ -13330,7 +13341,6 @@ compute_tip_xy (f, parms, dx, dy, width, height, root_x, root_y)
13330 int *root_x, *root_y; 13341 int *root_x, *root_y;
13331{ 13342{
13332 Lisp_Object left, top; 13343 Lisp_Object left, top;
13333 unsigned pmask;
13334 13344
13335 /* User-specified position? */ 13345 /* User-specified position? */
13336 left = Fcdr (Fassq (Qleft, parms)); 13346 left = Fcdr (Fassq (Qleft, parms));
@@ -13361,7 +13371,7 @@ compute_tip_xy (f, parms, dx, dy, width, height, root_x, root_y)
13361 13371
13362 if (INTEGERP (left)) 13372 if (INTEGERP (left))
13363 *root_x = XINT (left); 13373 *root_x = XINT (left);
13364 else if (*root_x + XINT (dx) + width > FRAME_WIDTH (f)) 13374 else if (*root_x + XINT (dx) + width > FRAME_W32_DISPLAY_INFO (f)->width)
13365 *root_x -= width + XINT (dx); 13375 *root_x -= width + XINT (dx);
13366 else 13376 else
13367 *root_x += XINT (dx); 13377 *root_x += XINT (dx);
@@ -13542,7 +13552,7 @@ Text larger than the specified size is clipped. */)
13542 row_width = row->pixel_width; 13552 row_width = row->pixel_width;
13543 13553
13544 /* TODO: find why tips do not draw along baseline as instructed. */ 13554 /* TODO: find why tips do not draw along baseline as instructed. */
13545 height += row->height * 2; 13555 height += row->height;
13546 width = max (width, row_width); 13556 width = max (width, row_width);
13547 } 13557 }
13548 13558
@@ -13556,10 +13566,24 @@ Text larger than the specified size is clipped. */)
13556 compute_tip_xy (f, parms, dx, dy, width, height, &root_x, &root_y); 13566 compute_tip_xy (f, parms, dx, dy, width, height, &root_x, &root_y);
13557 13567
13558 BLOCK_INPUT; 13568 BLOCK_INPUT;
13559 SetWindowPos (FRAME_W32_WINDOW (f), HWND_TOPMOST, 13569 {
13560 root_x, root_y - height, width, height, 13570 /* Adjust Window size to take border into account. */
13561 SWP_NOACTIVATE); 13571 RECT rect;
13562 my_show_window (f, FRAME_W32_WINDOW (f), SW_SHOWNORMAL); 13572 rect.left = rect.top = 0;
13573 rect.right = width;
13574 rect.bottom = height;
13575 AdjustWindowRect (&rect, f->output_data.w32->dwStyle,
13576 FRAME_EXTERNAL_MENU_BAR (f));
13577
13578 SetWindowPos (FRAME_W32_WINDOW (f), HWND_TOPMOST,
13579 root_x, root_y, rect.right - rect.left,
13580 rect.bottom - rect.top, SWP_NOACTIVATE);
13581
13582 /* Let redisplay know that we have made the frame visible already. */
13583 f->async_visible = 1;
13584
13585 ShowWindow (FRAME_W32_WINDOW (f), SW_SHOWNOACTIVATE);
13586 }
13563 UNBLOCK_INPUT; 13587 UNBLOCK_INPUT;
13564 13588
13565 /* Draw into the window. */ 13589 /* Draw into the window. */