• R/O
  • SSH

Commit

Tags
No Tags

Frequently used words (click to add to your profile)

javaandroidc++linuxc#objective-c誰得qtcocoapythonrubywindowsphpgameguibathyscaphec翻訳omegat計画中(planning stage)frameworktwitterdombtronvb.nettestarduinodirectxpreviewerゲームエンジン

K.Takata's patch queue for Vim


Commit MetaInfo

Revision4c6a3ac4e6ba8c0631b5c89842f5162c338f1c5c (tree)
Time2022-01-15 09:44:53
AuthorK.Takata <kentkt@csc....>
CommiterK.Takata

Log Message

Update permonitorv2

Change Summary

Incremental Difference

diff -r da14932baa62 -r 4c6a3ac4e6ba win32-permonitorv2.patch
--- a/win32-permonitorv2.patch Sat Jan 15 00:31:08 2022 +0900
+++ b/win32-permonitorv2.patch Sat Jan 15 09:44:53 2022 +0900
@@ -1,5 +1,5 @@
11 # HG changeset patch
2-# Parent 887d7f41d88e2a065e0cdcc9523d08422d6368bd
2+# Parent a7f575af18dd59e86011961ae073200cedf5decc
33
44 diff --git a/src/gui.c b/src/gui.c
55 --- a/src/gui.c
@@ -187,7 +187,21 @@
187187 return (ypad < 0) ? 0 : ypad;
188188 }
189189
190-@@ -1545,7 +1604,10 @@ gui_mch_get_font(
190+@@ -1467,6 +1526,13 @@ gui_mswin_find_scrollbar(HWND hwnd)
191+ return NULL;
192+ }
193+
194++ static void
195++update_scrollbar_size(void)
196++{
197++ gui.scrollbar_width = pGetSystemMetricsForDpi(SM_CXVSCROLL, s_dpi);
198++ gui.scrollbar_height = pGetSystemMetricsForDpi(SM_CYHSCROLL, s_dpi);
199++}
200++
201+ /*
202+ * Get the character size of a font.
203+ */
204+@@ -1545,7 +1611,10 @@ gui_mch_get_font(
191205 GuiFont font = NOFONT;
192206
193207 if (get_logfont(&lf, name, NULL, giveErrorIfMissing) == OK)
@@ -198,7 +212,7 @@
198212 if (font == NOFONT && giveErrorIfMissing)
199213 semsg(_(e_unknown_font_str), name);
200214 return font;
201-@@ -2858,7 +2920,7 @@ gui_mch_show_popupmenu_at(vimmenu_T *men
215+@@ -2858,7 +2927,7 @@ gui_mch_show_popupmenu_at(vimmenu_T *men
202216 int cx,
203217 int cy)
204218 {
@@ -207,7 +221,7 @@
207221 {
208222 gui_resize_shell(cx, cy);
209223
210-@@ -2949,12 +3011,12 @@ gui_mswin_get_valid_dimensions(
224+@@ -2949,12 +3018,12 @@ gui_mswin_get_valid_dimensions(
211225 int base_width, base_height;
212226
213227 base_width = gui_get_base_width()
@@ -225,7 +239,7 @@
225239 #ifdef FEAT_MENU
226240 + gui_mswin_get_menu_height(FALSE)
227241 #endif
228-@@ -3316,7 +3378,10 @@ gui_mch_init_font(char_u *font_name, int
242+@@ -3316,7 +3385,10 @@ gui_mch_init_font(char_u *font_name, int
229243
230244 // Load the font
231245 if (get_logfont(&lf, font_name, NULL, TRUE) == OK)
@@ -236,7 +250,7 @@
236250 if (font == NOFONT)
237251 return FAIL;
238252
239-@@ -3342,7 +3407,6 @@ gui_mch_init_font(char_u *font_name, int
253+@@ -3342,7 +3414,6 @@ gui_mch_init_font(char_u *font_name, int
240254 hl_set_font_name(p);
241255
242256 // When setting 'guifont' to "*" replace it with the actual font name.
@@ -244,7 +258,7 @@
244258 if (STRCMP(font_name, "*") == 0 && STRCMP(p_guifont, "*") == 0)
245259 {
246260 vim_free(p_guifont);
247-@@ -3428,12 +3492,12 @@ gui_mch_newfont(void)
261+@@ -3428,12 +3499,12 @@ gui_mch_newfont(void)
248262 if (win_socket_id == 0)
249263 {
250264 gui_resize_shell(rect.right - rect.left
@@ -262,7 +276,7 @@
262276 #ifdef FEAT_MENU
263277 - gui_mswin_get_menu_height(FALSE)
264278 #endif
265-@@ -4101,7 +4165,7 @@ typedef HRESULT (WINAPI* DLLGETVERSIONPR
279+@@ -4101,7 +4172,7 @@ typedef HRESULT (WINAPI* DLLGETVERSIONPR
266280 #if defined(FEAT_TOOLBAR) || defined(FEAT_GUI_TABLINE)
267281 // Older MSVC compilers don't have LPNMTTDISPINFO[AW] thus we need to define
268282 // it here if LPNMTTDISPINFO isn't defined.
@@ -271,7 +285,7 @@
271285 // _MSC_VER.
272286 # if !defined(LPNMTTDISPINFO) && defined(_MSC_VER)
273287 typedef struct tagNMTTDISPINFOA {
274-@@ -4178,6 +4242,7 @@ static int mouse_scroll_lines = 0;
288+@@ -4178,6 +4249,7 @@ static int mouse_scroll_lines = 0;
275289 static int s_usenewlook; // emulate W95/NT4 non-bold dialogs
276290 #ifdef FEAT_TOOLBAR
277291 static void initialise_toolbar(void);
@@ -279,7 +293,7 @@
279293 static LRESULT CALLBACK toolbar_wndproc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam);
280294 static int get_toolbar_bitmap(vimmenu_T *menu);
281295 #endif
282-@@ -4419,6 +4484,7 @@ set_tabline_font(void)
296+@@ -4419,6 +4491,7 @@ set_tabline_font(void)
283297 if (gui_w32_get_menu_font(&lfSysmenu) != OK)
284298 return;
285299
@@ -287,7 +301,7 @@
287301 font = CreateFontIndirectW(&lfSysmenu);
288302
289303 SendMessage(s_tabhwnd, WM_SETFONT, (WPARAM)font, TRUE);
290-@@ -4556,6 +4622,28 @@ destroy_sizing_tip(void)
304+@@ -4556,6 +4629,26 @@ destroy_sizing_tip(void)
291305 return TRUE;
292306 }
293307
@@ -298,9 +312,7 @@
298312 + s_in_dpichanged = TRUE;
299313 + //TRACE("DPI: %d", ydpi);
300314 +
301-+ gui.scrollbar_width = pGetSystemMetricsForDpi(SM_CXVSCROLL, s_dpi);
302-+ gui.scrollbar_height = pGetSystemMetricsForDpi(SM_CYHSCROLL, s_dpi);
303-+
315++ update_scrollbar_size();
304316 +#ifdef FEAT_TOOLBAR
305317 + update_toolbar_size();
306318 +#endif
@@ -316,7 +328,7 @@
316328
317329
318330 static LRESULT CALLBACK
319-@@ -4916,6 +5004,9 @@ destroy_sizing_tip(void)
331+@@ -4916,6 +5009,9 @@ destroy_sizing_tip(void)
320332 return MyWindowProc(hwnd, uMsg, wParam, lParam);
321333 return 1L;
322334 #endif
@@ -326,7 +338,7 @@
326338
327339 default:
328340 #ifdef MSWIN_FIND_REPLACE
329-@@ -5269,6 +5360,37 @@ gui_mch_prepare(int *argc, char **argv)
341+@@ -5269,6 +5365,37 @@ gui_mch_prepare(int *argc, char **argv)
330342 #endif
331343 }
332344
@@ -364,7 +376,7 @@
364376 /*
365377 * Initialise the GUI. Create all the windows, set up all the call-backs
366378 * etc.
367-@@ -5295,12 +5417,17 @@ gui_mch_init(void)
379+@@ -5295,12 +5422,18 @@ gui_mch_init(void)
368380 s_htearbitmap = LoadBitmap(g_hinst, "IDB_TEAROFF");
369381 #endif
370382
@@ -372,8 +384,9 @@
372384 - gui.scrollbar_height = GetSystemMetrics(SM_CYHSCROLL);
373385 + load_dpi_func();
374386 +
375-+ gui.scrollbar_width = pGetSystemMetricsForDpi(SM_CXVSCROLL, s_dpi);
376-+ gui.scrollbar_height = pGetSystemMetricsForDpi(SM_CYHSCROLL, s_dpi);
387++ s_dpi = pGetDpiForSystem(s_hwnd);
388++ update_scrollbar_size();
389++
377390 #ifdef FEAT_MENU
378391 gui.menu_height = 0; // Windows takes care of this
379392 #endif
@@ -384,22 +397,21 @@
384397
385398 s_brush = CreateSolidBrush(GetSysColor(COLOR_BTNFACE));
386399
387-@@ -5389,6 +5516,14 @@ gui_mch_init(void)
400+@@ -5389,6 +5522,13 @@ gui_mch_init(void)
388401 if (s_hwnd == NULL)
389402 return FAIL;
390403
391404 + if (pGetDpiForWindow != NULL)
392405 + {
393406 + s_dpi = pGetDpiForWindow(s_hwnd);
394-+ gui.scrollbar_width = pGetSystemMetricsForDpi(SM_CXVSCROLL, s_dpi);
395-+ gui.scrollbar_height = pGetSystemMetricsForDpi(SM_CYHSCROLL, s_dpi);
407++ update_scrollbar_size();
396408 + //TRACE("System DPI: %d, DPI: %d", pGetDpiForSystem(), s_dpi);
397409 + }
398410 +
399411 #ifdef GLOBAL_IME
400412 global_ime_init(atom, s_hwnd);
401413 #endif
402-@@ -5444,7 +5579,7 @@ gui_mch_init(void)
414+@@ -5444,7 +5584,7 @@ gui_mch_init(void)
403415 DragAcceptFiles(s_hwnd, TRUE);
404416
405417 // Do we need to bother with this?
@@ -408,7 +420,7 @@
408420
409421 // Get background/foreground colors from the system
410422 gui_mch_def_colors();
411-@@ -5586,11 +5721,11 @@ gui_mch_set_shellsize(
423+@@ -5586,11 +5726,11 @@ gui_mch_set_shellsize(
412424 GetWindowRect(s_hwnd, &window_rect);
413425
414426 // compute the size of the outside of the window
@@ -425,7 +437,7 @@
425437 #ifdef FEAT_MENU
426438 + gui_mswin_get_menu_height(FALSE)
427439 #endif
428-@@ -6491,16 +6626,16 @@ gui_mch_get_screen_dimensions(int *scree
440+@@ -6491,16 +6631,16 @@ gui_mch_get_screen_dimensions(int *scree
429441 get_work_area(&workarea_rect);
430442
431443 *screen_w = workarea_rect.right - workarea_rect.left
@@ -447,7 +459,7 @@
447459 #ifdef FEAT_MENU
448460 - gui_mswin_get_menu_height(FALSE)
449461 #endif
450-@@ -6958,6 +7093,9 @@ gui_mch_dialog(
462+@@ -6958,6 +7098,9 @@ gui_mch_dialog(
451463 # endif
452464 garray_T ga;
453465 int l;
@@ -457,7 +469,7 @@
457469
458470 # ifndef NO_CONSOLE
459471 // Don't output anything in silent mode ("ex -s")
460-@@ -6969,7 +7107,13 @@ gui_mch_dialog(
472+@@ -6969,7 +7112,13 @@ gui_mch_dialog(
461473 # endif
462474
463475 if (s_hwnd == NULL)
@@ -471,7 +483,7 @@
471483
472484 if ((type < 0) || (type > VIM_LAST_TYPE))
473485 type = 0;
474-@@ -7027,7 +7171,7 @@ gui_mch_dialog(
486+@@ -7027,7 +7176,7 @@ gui_mch_dialog(
475487 else
476488 # endif
477489 font = CreateFont(-DLG_FONT_POINT_SIZE, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
@@ -480,7 +492,7 @@
480492 if (s_usenewlook)
481493 {
482494 oldFont = SelectFont(hdc, font);
483-@@ -7054,8 +7198,8 @@ gui_mch_dialog(
495+@@ -7054,8 +7203,8 @@ gui_mch_dialog(
484496 // We don't have a window, use the desktop area.
485497 get_work_area(&workarea_rect);
486498 maxDialogWidth = workarea_rect.right - workarea_rect.left - 100;
@@ -491,7 +503,7 @@
491503 // Leave some room for the taskbar.
492504 maxDialogHeight = workarea_rect.bottom - workarea_rect.top - 150;
493505 }
494-@@ -7064,17 +7208,17 @@ gui_mch_dialog(
506+@@ -7064,17 +7213,17 @@ gui_mch_dialog(
495507 // Use our own window for the size, unless it's very small.
496508 GetWindowRect(s_hwnd, &rect);
497509 maxDialogWidth = rect.right - rect.left
@@ -499,8 +511,8 @@
499511 - GetSystemMetrics(SM_CXPADDEDBORDER)) * 2;
500512 - if (maxDialogWidth < DLG_MIN_MAX_WIDTH)
501513 - maxDialogWidth = DLG_MIN_MAX_WIDTH;
502-+ - (pGetSystemMetricsForDpi(SM_CXFRAME, dpi) +
503-+ pGetSystemMetricsForDpi(SM_CXPADDEDBORDER, dpi)) * 2;
514++ - (pGetSystemMetricsForDpi(SM_CXFRAME, dpi) +
515++ pGetSystemMetricsForDpi(SM_CXPADDEDBORDER, dpi)) * 2;
504516 + if (maxDialogWidth < adjust_by_system_dpi(DLG_MIN_MAX_WIDTH))
505517 + maxDialogWidth = adjust_by_system_dpi(DLG_MIN_MAX_WIDTH);
506518
@@ -510,15 +522,15 @@
510522 - - GetSystemMetrics(SM_CYCAPTION);
511523 - if (maxDialogHeight < DLG_MIN_MAX_HEIGHT)
512524 - maxDialogHeight = DLG_MIN_MAX_HEIGHT;
513-+ - (pGetSystemMetricsForDpi(SM_CYFRAME, dpi) +
514-+ pGetSystemMetricsForDpi(SM_CXPADDEDBORDER, dpi)) * 4
515-+ - pGetSystemMetricsForDpi(SM_CYCAPTION, dpi);
525++ - (pGetSystemMetricsForDpi(SM_CYFRAME, dpi) +
526++ pGetSystemMetricsForDpi(SM_CXPADDEDBORDER, dpi)) * 4
527++ - pGetSystemMetricsForDpi(SM_CYCAPTION, dpi);
516528 + if (maxDialogHeight < adjust_by_system_dpi(DLG_MIN_MAX_HEIGHT))
517529 + maxDialogHeight = adjust_by_system_dpi(DLG_MIN_MAX_HEIGHT);
518530 }
519531
520532 // Set dlgwidth to width of message.
521-@@ -7110,7 +7254,8 @@ gui_mch_dialog(
533+@@ -7110,7 +7259,8 @@ gui_mch_dialog(
522534 if (last_white != NULL)
523535 {
524536 // break the line just after a space
@@ -528,7 +540,7 @@
528540 pend = last_white + 1;
529541 last_white = NULL;
530542 }
531-@@ -7135,12 +7280,15 @@ gui_mch_dialog(
543+@@ -7135,12 +7285,15 @@ gui_mch_dialog(
532544
533545 messageWidth += 10; // roundoff space
534546
@@ -549,7 +561,7 @@
549561
550562 /*
551563 * Check button names. A long one will make the dialog wider.
552-@@ -7228,7 +7376,7 @@ gui_mch_dialog(
564+@@ -7228,7 +7381,7 @@ gui_mch_dialog(
553565 dlgheight = maxDialogHeight;
554566 scroll_flag = WS_VSCROLL;
555567 // Make sure scrollbar doesn't appear in the middle of the dialog
@@ -558,7 +570,7 @@
558570 }
559571
560572 add_word(PixelToDialogY(dlgheight));
561-@@ -7325,14 +7473,14 @@ gui_mch_dialog(
573+@@ -7325,14 +7478,14 @@ gui_mch_dialog(
562574 p = add_dialog_element(p, SS_ICON,
563575 PixelToDialogX(dlgPaddingX),
564576 PixelToDialogY(dlgPaddingY),
@@ -576,7 +588,7 @@
576588 PixelToDialogY(dlgPaddingY),
577589 (WORD)(PixelToDialogX(messageWidth) + 1),
578590 PixelToDialogY(msgheight),
579-@@ -7626,7 +7774,7 @@ get_dialog_font_metrics(void)
591+@@ -7626,7 +7779,7 @@ get_dialog_font_metrics(void)
580592 else
581593 #endif
582594 hfontTools = CreateFont(-DLG_FONT_POINT_SIZE, 0, 0, 0, 0, 0, 0, 0,
@@ -585,7 +597,7 @@
585597
586598 if (hfontTools)
587599 {
588-@@ -7732,7 +7880,7 @@ gui_mch_tearoff(
600+@@ -7732,7 +7885,7 @@ gui_mch_tearoff(
589601 else
590602 # endif
591603 font = CreateFont(-DLG_FONT_POINT_SIZE, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
@@ -594,7 +606,7 @@
594606 if (s_usenewlook)
595607 oldFont = SelectFont(hdc, font);
596608 else
597-@@ -8031,6 +8179,33 @@ initialise_toolbar(void)
609+@@ -8031,6 +8184,33 @@ initialise_toolbar(void)
598610 s_toolbar_wndproc = SubclassWindow(s_toolbarhwnd, toolbar_wndproc);
599611
600612 gui_mch_show_toolbar(vim_strchr(p_go, GO_TOOLBAR) != NULL);
@@ -628,7 +640,7 @@
628640 }
629641
630642 static LRESULT CALLBACK
631-@@ -8143,7 +8318,7 @@ GetTabFromPoint(
643+@@ -8143,7 +8323,7 @@ GetTabFromPoint(
632644 {
633645 TCHITTESTINFO htinfo;
634646 htinfo.pt = pt;
@@ -637,7 +649,7 @@
637649 if (s_tabhwnd == hWnd)
638650 {
639651 int idx = TabCtrl_HitTest(s_tabhwnd, &htinfo);
640-@@ -8189,7 +8364,8 @@ tabline_wndproc(
652+@@ -8189,7 +8369,8 @@ tabline_wndproc(
641653 {
642654 pt.x = GET_X_LPARAM(lParam);
643655 pt.y = s_pt.y;