comparison src/mbyte.c @ 14575:f8cd07a1cbb5 v8.1.0301

patch 8.1.0301: GTK: input method popup displayed on wrong screen. commit https://github.com/vim/vim/commit/3f6a16f022c437eccaeb683640b25a972cb1b376 Author: Bram Moolenaar <Bram@vim.org> Date: Sun Aug 19 22:58:45 2018 +0200 patch 8.1.0301: GTK: input method popup displayed on wrong screen. Problem: GTK: Input method popup displayed on wrong screen. Solution: Add the screen position offset. (Ken Takata, closes https://github.com/vim/vim/issues/3268)
author Christian Brabandt <cb@256bit.org>
date Sun, 19 Aug 2018 23:00:06 +0200
parents e4c553e9132b
children 82e7ce311065
comparison
equal deleted inserted replaced
14574:4ba20935ebe7 14575:f8cd07a1cbb5
4949 } 4949 }
4950 4950
4951 static void 4951 static void
4952 im_preedit_window_set_position(void) 4952 im_preedit_window_set_position(void)
4953 { 4953 {
4954 int x, y, w, h, sw, sh; 4954 int x, y, width, height;
4955 int screen_x, screen_y, screen_width, screen_height;
4955 4956
4956 if (preedit_window == NULL) 4957 if (preedit_window == NULL)
4957 return; 4958 return;
4958 4959
4959 gui_gtk_get_screen_size_of_win(preedit_window, &sw, &sh); 4960 gui_gtk_get_screen_geom_of_win(gui.drawarea,
4961 &screen_x, &screen_y, &screen_width, &screen_height);
4960 #if GTK_CHECK_VERSION(3,0,0) 4962 #if GTK_CHECK_VERSION(3,0,0)
4961 gdk_window_get_origin(gtk_widget_get_window(gui.drawarea), &x, &y); 4963 gdk_window_get_origin(gtk_widget_get_window(gui.drawarea), &x, &y);
4962 #else 4964 #else
4963 gdk_window_get_origin(gui.drawarea->window, &x, &y); 4965 gdk_window_get_origin(gui.drawarea->window, &x, &y);
4964 #endif 4966 #endif
4965 gtk_window_get_size(GTK_WINDOW(preedit_window), &w, &h); 4967 gtk_window_get_size(GTK_WINDOW(preedit_window), &width, &height);
4966 x = x + FILL_X(gui.col); 4968 x = x + FILL_X(gui.col);
4967 y = y + FILL_Y(gui.row); 4969 y = y + FILL_Y(gui.row);
4968 if (x + w > sw) 4970 if (x + width > screen_x + screen_width)
4969 x = sw - w; 4971 x = screen_x + screen_width - width;
4970 if (y + h > sh) 4972 if (y + height > screen_y + screen_height)
4971 y = sh - h; 4973 y = screen_y + screen_height - height;
4972 gtk_window_move(GTK_WINDOW(preedit_window), x, y); 4974 gtk_window_move(GTK_WINDOW(preedit_window), x, y);
4973 } 4975 }
4974 4976
4975 static void 4977 static void
4976 im_preedit_window_open() 4978 im_preedit_window_open()