• R/O
  • SSH

コミット

タグ
未設定

よく使われているワード(クリックで追加)

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

K.Takata's patch queue for Vim


コミットメタ情報

リビジョンe2138bc9e88fd5916dede54bce87540f5da971e5 (tree)
日時2022-01-15 15:43:58
作者K.Takata <kentkt@csc....>
コミッターK.Takata

ログメッセージ

Fix IME in permonitorv2

変更サマリ

差分

diff -r 55cfc1c5e2fe -r e2138bc9e88f win32-permonitorv2.patch
--- a/win32-permonitorv2.patch Sat Jan 15 13:16:24 2022 +0900
+++ b/win32-permonitorv2.patch Sat Jan 15 15:43:58 2022 +0900
@@ -260,7 +260,7 @@
260260 *cols = (w - base_width) / gui.char_width;
261261 *rows = (h - base_height) / gui.char_height;
262262 *valid_w = base_width + *cols * gui.char_width;
263-@@ -3245,12 +3311,12 @@ logfont2name(LOGFONTW lf)
263+@@ -3245,7 +3311,7 @@ logfont2name(LOGFONTW lf)
264264 #ifdef FEAT_MBYTE_IME
265265 /*
266266 * Set correct LOGFONTW to IME. Use 'guifontwide' if available, otherwise use
@@ -269,24 +269,7 @@
269269 */
270270 static void
271271 update_im_font(void)
272- {
273-- LOGFONTW lf_wide;
274-+ LOGFONTW lf_wide, lf;
275-
276- if (p_guifontwide != NULL && *p_guifontwide != NUL
277- && gui.wide_font != NOFONT
278-@@ -3258,7 +3324,9 @@ update_im_font(void)
279- norm_logfont = lf_wide;
280- else
281- norm_logfont = sub_logfont;
282-- im_set_font(&norm_logfont);
283-+ lf = norm_logfont;
284-+ lf.lfHeight = lf.lfHeight * (int)pGetDpiForSystem() / s_dpi;
285-+ im_set_font(&lf);
286- }
287- #endif
288-
289-@@ -3310,13 +3378,17 @@ gui_mch_wide_font_changed(void)
272+@@ -3310,13 +3376,17 @@ gui_mch_wide_font_changed(void)
290273 int
291274 gui_mch_init_font(char_u *font_name, int fontset UNUSED)
292275 {
@@ -305,7 +288,7 @@
305288 if (font == NOFONT)
306289 return FAIL;
307290
308-@@ -3329,20 +3401,20 @@ gui_mch_init_font(char_u *font_name, int
291+@@ -3329,20 +3399,20 @@ gui_mch_init_font(char_u *font_name, int
309292 sub_logfont = lf;
310293 #endif
311294 #ifdef FEAT_MBYTE_IME
@@ -330,7 +313,7 @@
330313 if (STRCMP(font_name, "*") == 0 && STRCMP(p_guifont, "*") == 0)
331314 {
332315 vim_free(p_guifont);
333-@@ -3428,26 +3500,19 @@ gui_mch_newfont(void)
316+@@ -3428,26 +3498,19 @@ gui_mch_newfont(void)
334317 if (win_socket_id == 0)
335318 {
336319 gui_resize_shell(rect.right - rect.left
@@ -364,7 +347,7 @@
364347 }
365348 }
366349
367-@@ -4101,7 +4166,7 @@ typedef HRESULT (WINAPI* DLLGETVERSIONPR
350+@@ -4101,7 +4164,7 @@ typedef HRESULT (WINAPI* DLLGETVERSIONPR
368351 #if defined(FEAT_TOOLBAR) || defined(FEAT_GUI_TABLINE)
369352 // Older MSVC compilers don't have LPNMTTDISPINFO[AW] thus we need to define
370353 // it here if LPNMTTDISPINFO isn't defined.
@@ -373,7 +356,7 @@
373356 // _MSC_VER.
374357 # if !defined(LPNMTTDISPINFO) && defined(_MSC_VER)
375358 typedef struct tagNMTTDISPINFOA {
376-@@ -4178,8 +4243,11 @@ static int mouse_scroll_lines = 0;
359+@@ -4178,8 +4241,11 @@ static int mouse_scroll_lines = 0;
377360 static int s_usenewlook; // emulate W95/NT4 non-bold dialogs
378361 #ifdef FEAT_TOOLBAR
379362 static void initialise_toolbar(void);
@@ -385,7 +368,7 @@
385368 #endif
386369
387370 #ifdef FEAT_GUI_TABLINE
388-@@ -4419,6 +4487,7 @@ set_tabline_font(void)
371+@@ -4419,6 +4485,7 @@ set_tabline_font(void)
389372 if (gui_w32_get_menu_font(&lfSysmenu) != OK)
390373 return;
391374
@@ -393,7 +376,7 @@
393376 font = CreateFontIndirectW(&lfSysmenu);
394377
395378 SendMessage(s_tabhwnd, WM_SETFONT, (WPARAM)font, TRUE);
396-@@ -4441,6 +4510,8 @@ set_tabline_font(void)
379+@@ -4441,6 +4508,8 @@ set_tabline_font(void)
397380 */
398381 gui.tabline_height = tm.tmHeight + tm.tmInternalLeading + 7;
399382 }
@@ -402,7 +385,7 @@
402385 #endif
403386
404387 /*
405-@@ -4452,10 +4523,8 @@ set_tabline_font(void)
388+@@ -4452,10 +4521,8 @@ set_tabline_font(void)
406389 if (n == SPI_SETWHEELSCROLLLINES)
407390 SystemParametersInfo(SPI_GETWHEELSCROLLLINES, 0,
408391 &mouse_scroll_lines, 0);
@@ -413,7 +396,7 @@
413396 return 0;
414397 }
415398
416-@@ -4556,6 +4625,28 @@ destroy_sizing_tip(void)
399+@@ -4556,6 +4623,28 @@ destroy_sizing_tip(void)
417400 return TRUE;
418401 }
419402
@@ -442,7 +425,7 @@
442425
443426
444427 static LRESULT CALLBACK
445-@@ -4916,6 +5007,9 @@ destroy_sizing_tip(void)
428+@@ -4916,6 +5005,9 @@ destroy_sizing_tip(void)
446429 return MyWindowProc(hwnd, uMsg, wParam, lParam);
447430 return 1L;
448431 #endif
@@ -452,7 +435,7 @@
452435
453436 default:
454437 #ifdef MSWIN_FIND_REPLACE
455-@@ -5269,6 +5363,37 @@ gui_mch_prepare(int *argc, char **argv)
438+@@ -5269,6 +5361,37 @@ gui_mch_prepare(int *argc, char **argv)
456439 #endif
457440 }
458441
@@ -490,7 +473,7 @@
490473 /*
491474 * Initialise the GUI. Create all the windows, set up all the call-backs
492475 * etc.
493-@@ -5295,12 +5420,18 @@ gui_mch_init(void)
476+@@ -5295,12 +5418,18 @@ gui_mch_init(void)
494477 s_htearbitmap = LoadBitmap(g_hinst, "IDB_TEAROFF");
495478 #endif
496479
@@ -511,7 +494,7 @@
511494
512495 s_brush = CreateSolidBrush(GetSysColor(COLOR_BTNFACE));
513496
514-@@ -5389,6 +5520,13 @@ gui_mch_init(void)
497+@@ -5389,6 +5518,13 @@ gui_mch_init(void)
515498 if (s_hwnd == NULL)
516499 return FAIL;
517500
@@ -525,7 +508,7 @@
525508 #ifdef GLOBAL_IME
526509 global_ime_init(atom, s_hwnd);
527510 #endif
528-@@ -5444,7 +5582,7 @@ gui_mch_init(void)
511+@@ -5444,7 +5580,7 @@ gui_mch_init(void)
529512 DragAcceptFiles(s_hwnd, TRUE);
530513
531514 // Do we need to bother with this?
@@ -534,7 +517,7 @@
534517
535518 // Get background/foreground colors from the system
536519 gui_mch_def_colors();
537-@@ -5586,15 +5724,12 @@ gui_mch_set_shellsize(
520+@@ -5586,15 +5722,12 @@ gui_mch_set_shellsize(
538521 GetWindowRect(s_hwnd, &window_rect);
539522
540523 // compute the size of the outside of the window
@@ -556,7 +539,7 @@
556539
557540 // The following should take care of keeping Vim on the same monitor, no
558541 // matter if the secondary monitor is left or right of the primary
559-@@ -5621,10 +5756,8 @@ gui_mch_set_shellsize(
542+@@ -5621,10 +5754,8 @@ gui_mch_set_shellsize(
560543 SetActiveWindow(s_hwnd);
561544 SetFocus(s_hwnd);
562545
@@ -567,28 +550,7 @@
567550 }
568551
569552
570-@@ -5722,7 +5855,10 @@ gui_mch_set_sp_color(guicolor_T color)
571- case IMN_SETOPENSTATUS:
572- if (pImmGetOpenStatus(hImc))
573- {
574-- pImmSetCompositionFontW(hImc, &norm_logfont);
575-+ LOGFONTW lf = norm_logfont;
576-+
577-+ lf.lfHeight = lf.lfHeight * (int)pGetDpiForSystem() / s_dpi;
578-+ pImmSetCompositionFontW(hImc, &lf);
579- im_set_position(gui.row, gui.col);
580-
581- // Disable langmap
582-@@ -5890,6 +6026,8 @@ im_set_position(int row, int col)
583- cfs.ptCurrentPos.x = FILL_X(col);
584- cfs.ptCurrentPos.y = FILL_Y(row);
585- MapWindowPoints(s_textArea, s_hwnd, &cfs.ptCurrentPos, 1);
586-+ cfs.ptCurrentPos.x = cfs.ptCurrentPos.x * (int)pGetDpiForSystem() / s_dpi;
587-+ cfs.ptCurrentPos.y = cfs.ptCurrentPos.y * (int)pGetDpiForSystem() / s_dpi;
588- pImmSetCompositionWindow(hImc, &cfs);
589-
590- pImmReleaseContext(s_hwnd, hImc);
591-@@ -6491,20 +6629,17 @@ gui_mch_get_screen_dimensions(int *scree
553+@@ -6491,20 +6622,17 @@ gui_mch_get_screen_dimensions(int *scree
592554 get_work_area(&workarea_rect);
593555
594556 *screen_w = workarea_rect.right - workarea_rect.left
@@ -615,7 +577,7 @@
615577 }
616578
617579
618-@@ -6958,6 +7093,9 @@ gui_mch_dialog(
580+@@ -6958,6 +7086,9 @@ gui_mch_dialog(
619581 # endif
620582 garray_T ga;
621583 int l;
@@ -625,7 +587,7 @@
625587
626588 # ifndef NO_CONSOLE
627589 // Don't output anything in silent mode ("ex -s")
628-@@ -6969,7 +7107,13 @@ gui_mch_dialog(
590+@@ -6969,7 +7100,13 @@ gui_mch_dialog(
629591 # endif
630592
631593 if (s_hwnd == NULL)
@@ -639,7 +601,7 @@
639601
640602 if ((type < 0) || (type > VIM_LAST_TYPE))
641603 type = 0;
642-@@ -7027,7 +7171,7 @@ gui_mch_dialog(
604+@@ -7027,7 +7164,7 @@ gui_mch_dialog(
643605 else
644606 # endif
645607 font = CreateFont(-DLG_FONT_POINT_SIZE, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
@@ -648,7 +610,7 @@
648610 if (s_usenewlook)
649611 {
650612 oldFont = SelectFont(hdc, font);
651-@@ -7054,8 +7198,8 @@ gui_mch_dialog(
613+@@ -7054,8 +7191,8 @@ gui_mch_dialog(
652614 // We don't have a window, use the desktop area.
653615 get_work_area(&workarea_rect);
654616 maxDialogWidth = workarea_rect.right - workarea_rect.left - 100;
@@ -659,7 +621,7 @@
659621 // Leave some room for the taskbar.
660622 maxDialogHeight = workarea_rect.bottom - workarea_rect.top - 150;
661623 }
662-@@ -7064,17 +7208,17 @@ gui_mch_dialog(
624+@@ -7064,17 +7201,17 @@ gui_mch_dialog(
663625 // Use our own window for the size, unless it's very small.
664626 GetWindowRect(s_hwnd, &rect);
665627 maxDialogWidth = rect.right - rect.left
@@ -686,7 +648,7 @@
686648 }
687649
688650 // Set dlgwidth to width of message.
689-@@ -7110,7 +7254,8 @@ gui_mch_dialog(
651+@@ -7110,7 +7247,8 @@ gui_mch_dialog(
690652 if (last_white != NULL)
691653 {
692654 // break the line just after a space
@@ -696,7 +658,7 @@
696658 pend = last_white + 1;
697659 last_white = NULL;
698660 }
699-@@ -7135,12 +7280,15 @@ gui_mch_dialog(
661+@@ -7135,12 +7273,15 @@ gui_mch_dialog(
700662
701663 messageWidth += 10; // roundoff space
702664
@@ -717,7 +679,7 @@
717679
718680 /*
719681 * Check button names. A long one will make the dialog wider.
720-@@ -7228,7 +7376,7 @@ gui_mch_dialog(
682+@@ -7228,7 +7369,7 @@ gui_mch_dialog(
721683 dlgheight = maxDialogHeight;
722684 scroll_flag = WS_VSCROLL;
723685 // Make sure scrollbar doesn't appear in the middle of the dialog
@@ -726,7 +688,7 @@
726688 }
727689
728690 add_word(PixelToDialogY(dlgheight));
729-@@ -7325,14 +7473,14 @@ gui_mch_dialog(
691+@@ -7325,14 +7466,14 @@ gui_mch_dialog(
730692 p = add_dialog_element(p, SS_ICON,
731693 PixelToDialogX(dlgPaddingX),
732694 PixelToDialogY(dlgPaddingY),
@@ -744,7 +706,7 @@
744706 PixelToDialogY(dlgPaddingY),
745707 (WORD)(PixelToDialogX(messageWidth) + 1),
746708 PixelToDialogY(msgheight),
747-@@ -7626,7 +7774,7 @@ get_dialog_font_metrics(void)
709+@@ -7626,7 +7767,7 @@ get_dialog_font_metrics(void)
748710 else
749711 #endif
750712 hfontTools = CreateFont(-DLG_FONT_POINT_SIZE, 0, 0, 0, 0, 0, 0, 0,
@@ -753,7 +715,7 @@
753715
754716 if (hfontTools)
755717 {
756-@@ -7732,7 +7880,7 @@ gui_mch_tearoff(
718+@@ -7732,7 +7873,7 @@ gui_mch_tearoff(
757719 else
758720 # endif
759721 font = CreateFont(-DLG_FONT_POINT_SIZE, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
@@ -762,7 +724,7 @@
762724 if (s_usenewlook)
763725 oldFont = SelectFont(hdc, font);
764726 else
765-@@ -8031,6 +8179,33 @@ initialise_toolbar(void)
727+@@ -8031,6 +8172,33 @@ initialise_toolbar(void)
766728 s_toolbar_wndproc = SubclassWindow(s_toolbarhwnd, toolbar_wndproc);
767729
768730 gui_mch_show_toolbar(vim_strchr(p_go, GO_TOOLBAR) != NULL);
@@ -796,7 +758,7 @@
796758 }
797759
798760 static LRESULT CALLBACK
799-@@ -8124,9 +8299,7 @@ initialise_tabline(void)
761+@@ -8124,9 +8292,7 @@ initialise_tabline(void)
800762
801763 gui.tabline_height = TABLINE_HEIGHT;
802764
@@ -806,7 +768,7 @@
806768 }
807769
808770 /*
809-@@ -8143,7 +8316,7 @@ GetTabFromPoint(
771+@@ -8143,7 +8309,7 @@ GetTabFromPoint(
810772 {
811773 TCHITTESTINFO htinfo;
812774 htinfo.pt = pt;
@@ -815,7 +777,7 @@
815777 if (s_tabhwnd == hWnd)
816778 {
817779 int idx = TabCtrl_HitTest(s_tabhwnd, &htinfo);
818-@@ -8189,7 +8362,8 @@ tabline_wndproc(
780+@@ -8189,7 +8355,8 @@ tabline_wndproc(
819781 {
820782 pt.x = GET_X_LPARAM(lParam);
821783 pt.y = s_pt.y;
@@ -837,7 +799,19 @@
837799 <assemblyIdentity
838800 processorArchitecture="*"
839801 version="8.2.0.0"
840-@@ -51,7 +51,7 @@
802+@@ -37,8 +37,9 @@
803+ </trustInfo>
804+ <!-- Vista High DPI aware -->
805+ <asmv3:application>
806+- <asmv3:windowsSettings xmlns="http://schemas.microsoft.com/SMI/2005/WindowsSettings">
807+- <dpiAware>true</dpiAware>
808++ <asmv3:windowsSettings>
809++ <dpiAware xmlns="http://schemas.microsoft.com/SMI/2005/WindowsSettings">true</dpiAware>
810++ <dpiAwareness xmlns="http://schemas.microsoft.com/SMI/2016/WindowsSettings">PerMonitorV2</dpiAwareness>
811+ </asmv3:windowsSettings>
812+ </asmv3:application>
813+ <compatibility xmlns="urn:schemas-microsoft-com:compatibility.v1">
814+@@ -51,7 +52,7 @@
841815 <supportedOS Id="{4a2f28e3-53b9-4441-ba9c-d69d4a4a6e38}"/>
842816 <!--The ID below indicates application support for Windows 8.1 -->
843817 <supportedOS Id="{1f676c76-80e1-4239-95bb-83d0f6d0da78}"/>