7cb51f2
To: vim-dev@vim.org
7cb51f2
Subject: Patch 7.2.263
7cb51f2
Fcc: outbox
7cb51f2
From: Bram Moolenaar <Bram@moolenaar.net>
7cb51f2
Mime-Version: 1.0
7cb51f2
Content-Type: text/plain; charset=UTF-8
7cb51f2
Content-Transfer-Encoding: 8bit
7cb51f2
------------
7cb51f2
7cb51f2
Patch 7.2.263
7cb51f2
Problem:    GTK2: when using the -geom argument with an offset from the right
7cb51f2
	    edge and the size is smaller than the default, the Vim window is
7cb51f2
	    not positioned properly.
7cb51f2
Solution:   Use another function to set the size. (Vitaly Minko)
7cb51f2
Files:	    src/gui_gtk_x11.c
7cb51f2
7cb51f2
7cb51f2
*** ../vim-7.2.262/src/gui_gtk_x11.c	2009-09-11 15:46:20.000000000 +0200
7cb51f2
--- src/gui_gtk_x11.c	2009-09-23 15:43:52.000000000 +0200
7cb51f2
***************
7cb51f2
*** 4066,4071 ****
7cb51f2
--- 4066,4073 ----
7cb51f2
  {
7cb51f2
      guicolor_T fg_pixel = INVALCOLOR;
7cb51f2
      guicolor_T bg_pixel = INVALCOLOR;
7cb51f2
+     guint		pixel_width;
7cb51f2
+     guint		pixel_height;
7cb51f2
  
7cb51f2
  #ifdef HAVE_GTK2
7cb51f2
      /*
7cb51f2
***************
7cb51f2
*** 4106,4113 ****
7cb51f2
  	unsigned int	w, h;
7cb51f2
  	int		x = 0;
7cb51f2
  	int		y = 0;
7cb51f2
- 	guint		pixel_width;
7cb51f2
- 	guint		pixel_height;
7cb51f2
  
7cb51f2
  	mask = XParseGeometry((char *)gui.geom, &x, &y, &w, &h);
7cb51f2
  
7cb51f2
--- 4108,4113 ----
7cb51f2
***************
7cb51f2
*** 4160,4168 ****
7cb51f2
  	}
7cb51f2
      }
7cb51f2
  
7cb51f2
!     gtk_form_set_size(GTK_FORM(gui.formwin),
7cb51f2
! 	    (guint)(gui_get_base_width() + Columns * gui.char_width),
7cb51f2
! 	    (guint)(gui_get_base_height() + Rows * gui.char_height));
7cb51f2
      update_window_manager_hints(0, 0);
7cb51f2
  
7cb51f2
      if (foreground_argument != NULL)
7cb51f2
--- 4160,4175 ----
7cb51f2
  	}
7cb51f2
      }
7cb51f2
  
7cb51f2
!     pixel_width = (guint)(gui_get_base_width() + Columns * gui.char_width);
7cb51f2
!     pixel_height = (guint)(gui_get_base_height() + Rows * gui.char_height);
7cb51f2
! #ifdef HAVE_GTK2
7cb51f2
!     /* For GTK2 changing the size of the form widget doesn't cause window
7cb51f2
!      * resizing. */
7cb51f2
!     if (gtk_socket_id == 0) 
7cb51f2
! 	gtk_window_resize(GTK_WINDOW(gui.mainwin), pixel_width, pixel_height);
7cb51f2
! #else
7cb51f2
!     gtk_form_set_size(GTK_FORM(gui.formwin), pixel_width, pixel_height);
7cb51f2
! #endif
7cb51f2
      update_window_manager_hints(0, 0);
7cb51f2
  
7cb51f2
      if (foreground_argument != NULL)
7cb51f2
*** ../vim-7.2.262/src/version.c	2009-09-18 17:24:54.000000000 +0200
7cb51f2
--- src/version.c	2009-09-23 17:34:08.000000000 +0200
7cb51f2
***************
7cb51f2
*** 678,679 ****
7cb51f2
--- 678,681 ----
7cb51f2
  {   /* Add new patch number below this line */
7cb51f2
+ /**/
7cb51f2
+     263,
7cb51f2
  /**/
7cb51f2
7cb51f2
-- 
7cb51f2
hundred-and-one symptoms of being an internet addict:
7cb51f2
267. You get an extra phone line so you can get phone calls.
7cb51f2
7cb51f2
 /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net   \\\
7cb51f2
///        sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
7cb51f2
\\\        download, build and distribute -- http://www.A-A-P.org        ///
7cb51f2
 \\\            help me help AIDS victims -- http://ICCF-Holland.org    ///