To: vim-dev@vim.org Subject: Patch 7.1.141 Fcc: outbox From: Bram Moolenaar Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 8bit ------------ Patch 7.1.141 Problem: GTK: -geom argument doesn't support a negative offset. Solution: Compute position from the right/lower corner. Files: src/gui_gtk_x11.c *** ../vim-7.1.140/src/gui_gtk_x11.c Sat Sep 15 14:06:41 2007 --- src/gui_gtk_x11.c Mon Oct 8 21:26:50 2007 *************** *** 4044,4049 **** --- 4044,4051 ---- unsigned int w, h; int x = 0; int y = 0; + guint pixel_width; + guint pixel_height; mask = XParseGeometry((char *)gui.geom, &x, &y, &w, &h); *************** *** 4055,4066 **** --- 4057,4087 ---- p_window = h - 1; Rows = h; } + + pixel_width = (guint)(gui_get_base_width() + Columns * gui.char_width); + pixel_height = (guint)(gui_get_base_height() + Rows * gui.char_height); + + #ifdef HAVE_GTK2 + pixel_width += get_menu_tool_width(); + pixel_height += get_menu_tool_height(); + #endif + if (mask & (XValue | YValue)) + { + int w, h; + gui_mch_get_screen_dimensions(&w, &h); + h += p_ghr + get_menu_tool_height(); + w += get_menu_tool_width(); + if (mask & XNegative) + x += w - pixel_width; + if (mask & YNegative) + y += h - pixel_height; #ifdef HAVE_GTK2 gtk_window_move(GTK_WINDOW(gui.mainwin), x, y); #else gtk_widget_set_uposition(gui.mainwin, x, y); #endif + } vim_free(gui.geom); gui.geom = NULL; *************** *** 4071,4084 **** */ if (gtk_socket_id != 0 && (mask & WidthValue || mask & HeightValue)) { - guint pixel_width = (guint)(gui_get_base_width() + Columns * gui.char_width); - guint pixel_height = (guint)(gui_get_base_height() + Rows * gui.char_height); - - #ifdef HAVE_GTK2 - pixel_width += get_menu_tool_width(); - pixel_height += get_menu_tool_height(); - #endif - update_window_manager_hints(pixel_width, pixel_height); init_window_hints_state = 1; g_timeout_add(1000, check_startup_plug_hints, NULL); --- 4092,4097 ---- *** ../vim-7.1.140/src/version.c Sun Oct 14 17:15:45 2007 --- src/version.c Fri Oct 19 14:28:52 2007 *************** *** 668,669 **** --- 668,671 ---- { /* Add new patch number below this line */ + /**/ + 141, /**/ -- hundred-and-one symptoms of being an internet addict: 35. Your husband tells you he's had the beard for 2 months. /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net \\\ /// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\ \\\ download, build and distribute -- http://www.A-A-P.org /// \\\ help me help AIDS victims -- http://ICCF-Holland.org ///