Karsten Hopp 6d6f47
To: vim_dev@googlegroups.com
Karsten Hopp 6d6f47
Subject: Patch 7.3.279
Karsten Hopp 6d6f47
Fcc: outbox
Karsten Hopp 6d6f47
From: Bram Moolenaar <Bram@moolenaar.net>
Karsten Hopp 6d6f47
Mime-Version: 1.0
Karsten Hopp 6d6f47
Content-Type: text/plain; charset=UTF-8
Karsten Hopp 6d6f47
Content-Transfer-Encoding: 8bit
Karsten Hopp 6d6f47
------------
Karsten Hopp 6d6f47
Karsten Hopp 6d6f47
Patch 7.3.279
Karsten Hopp 6d6f47
Problem:    With GTK, when gvim is full-screen and a tab is opened and using a
Karsten Hopp 6d6f47
	    specific monitor configuration the window is too big.
Karsten Hopp 6d6f47
Solution:   Adjust the window size like on MS-Windows. (Yukihiro Nakadaira)
Karsten Hopp 6d6f47
Files:	    src/gui.c, src/gui_gtk_x11.c, src/proto/gui_gtk_x11.pro
Karsten Hopp 6d6f47
Karsten Hopp 6d6f47
Karsten Hopp 6d6f47
*** ../vim-7.3.278/src/gui.c	2011-06-26 04:48:56.000000000 +0200
Karsten Hopp 6d6f47
--- src/gui.c	2011-08-10 17:40:31.000000000 +0200
Karsten Hopp 6d6f47
***************
Karsten Hopp 6d6f47
*** 1407,1413 ****
Karsten Hopp 6d6f47
      if (!gui.shell_created)
Karsten Hopp 6d6f47
  	return;
Karsten Hopp 6d6f47
  
Karsten Hopp 6d6f47
! #ifdef MSWIN
Karsten Hopp 6d6f47
      /* If not setting to a user specified size and maximized, calculate the
Karsten Hopp 6d6f47
       * number of characters that fit in the maximized window. */
Karsten Hopp 6d6f47
      if (!mustset && gui_mch_maximized())
Karsten Hopp 6d6f47
--- 1407,1413 ----
Karsten Hopp 6d6f47
      if (!gui.shell_created)
Karsten Hopp 6d6f47
  	return;
Karsten Hopp 6d6f47
  
Karsten Hopp 6d6f47
! #if defined(MSWIN) || defined(FEAT_GUI_GTK)
Karsten Hopp 6d6f47
      /* If not setting to a user specified size and maximized, calculate the
Karsten Hopp 6d6f47
       * number of characters that fit in the maximized window. */
Karsten Hopp 6d6f47
      if (!mustset && gui_mch_maximized())
Karsten Hopp 6d6f47
*** ../vim-7.3.278/src/gui_gtk_x11.c	2011-06-26 04:48:56.000000000 +0200
Karsten Hopp 6d6f47
--- src/gui_gtk_x11.c	2011-08-10 17:42:19.000000000 +0200
Karsten Hopp 6d6f47
***************
Karsten Hopp 6d6f47
*** 3900,3905 ****
Karsten Hopp 6d6f47
--- 3900,3920 ----
Karsten Hopp 6d6f47
  }
Karsten Hopp 6d6f47
  
Karsten Hopp 6d6f47
  /*
Karsten Hopp 6d6f47
+  * Called when the font changed while the window is maximized.  Compute the
Karsten Hopp 6d6f47
+  * new Rows and Columns.  This is like resizing the window.
Karsten Hopp 6d6f47
+  */
Karsten Hopp 6d6f47
+     void
Karsten Hopp 6d6f47
+ gui_mch_newfont()
Karsten Hopp 6d6f47
+ {
Karsten Hopp 6d6f47
+     int w, h;
Karsten Hopp 6d6f47
+ 
Karsten Hopp 6d6f47
+     gtk_window_get_size(GTK_WINDOW(gui.mainwin), &w, &h);
Karsten Hopp 6d6f47
+     w -= get_menu_tool_width();
Karsten Hopp 6d6f47
+     h -= get_menu_tool_height();
Karsten Hopp 6d6f47
+     gui_resize_shell(w, h);
Karsten Hopp 6d6f47
+ }
Karsten Hopp 6d6f47
+ 
Karsten Hopp 6d6f47
+ /*
Karsten Hopp 6d6f47
   * Set the windows size.
Karsten Hopp 6d6f47
   */
Karsten Hopp 6d6f47
      void
Karsten Hopp 6d6f47
***************
Karsten Hopp 6d6f47
*** 4409,4422 ****
Karsten Hopp 6d6f47
  
Karsten Hopp 6d6f47
      if (gui_mch_maximized())
Karsten Hopp 6d6f47
      {
Karsten Hopp 6d6f47
- 	int w, h;
Karsten Hopp 6d6f47
- 
Karsten Hopp 6d6f47
  	/* Update lines and columns in accordance with the new font, keep the
Karsten Hopp 6d6f47
  	 * window maximized. */
Karsten Hopp 6d6f47
! 	gtk_window_get_size(GTK_WINDOW(gui.mainwin), &w, &h);
Karsten Hopp 6d6f47
! 	w -= get_menu_tool_width();
Karsten Hopp 6d6f47
! 	h -= get_menu_tool_height();
Karsten Hopp 6d6f47
! 	gui_resize_shell(w, h);
Karsten Hopp 6d6f47
      }
Karsten Hopp 6d6f47
      else
Karsten Hopp 6d6f47
      {
Karsten Hopp 6d6f47
--- 4424,4432 ----
Karsten Hopp 6d6f47
  
Karsten Hopp 6d6f47
      if (gui_mch_maximized())
Karsten Hopp 6d6f47
      {
Karsten Hopp 6d6f47
  	/* Update lines and columns in accordance with the new font, keep the
Karsten Hopp 6d6f47
  	 * window maximized. */
Karsten Hopp 6d6f47
! 	gui_mch_newfont();
Karsten Hopp 6d6f47
      }
Karsten Hopp 6d6f47
      else
Karsten Hopp 6d6f47
      {
Karsten Hopp 6d6f47
*** ../vim-7.3.278/src/proto/gui_gtk_x11.pro	2010-08-15 21:57:28.000000000 +0200
Karsten Hopp 6d6f47
--- src/proto/gui_gtk_x11.pro	2011-08-10 17:42:29.000000000 +0200
Karsten Hopp 6d6f47
***************
Karsten Hopp 6d6f47
*** 20,25 ****
Karsten Hopp 6d6f47
--- 20,26 ----
Karsten Hopp 6d6f47
  void gui_mch_set_winpos __ARGS((int x, int y));
Karsten Hopp 6d6f47
  int gui_mch_maximized __ARGS((void));
Karsten Hopp 6d6f47
  void gui_mch_unmaximize __ARGS((void));
Karsten Hopp 6d6f47
+ void gui_mch_newfont __ARGS((void));
Karsten Hopp 6d6f47
  void gui_mch_set_shellsize __ARGS((int width, int height, int min_width, int min_height, int base_width, int base_height, int direction));
Karsten Hopp 6d6f47
  void gui_mch_get_screen_dimensions __ARGS((int *screen_w, int *screen_h));
Karsten Hopp 6d6f47
  void gui_mch_settitle __ARGS((char_u *title, char_u *icon));
Karsten Hopp 6d6f47
*** ../vim-7.3.278/src/version.c	2011-08-10 17:25:48.000000000 +0200
Karsten Hopp 6d6f47
--- src/version.c	2011-08-10 17:43:22.000000000 +0200
Karsten Hopp 6d6f47
***************
Karsten Hopp 6d6f47
*** 711,712 ****
Karsten Hopp 6d6f47
--- 711,714 ----
Karsten Hopp 6d6f47
  {   /* Add new patch number below this line */
Karsten Hopp 6d6f47
+ /**/
Karsten Hopp 6d6f47
+     279,
Karsten Hopp 6d6f47
  /**/
Karsten Hopp 6d6f47
Karsten Hopp 6d6f47
-- 
Karsten Hopp 6d6f47
LAUNCELOT: Isn't there a St. Aaaaarrrrrrggghhh's in Cornwall?
Karsten Hopp 6d6f47
ARTHUR:    No, that's Saint Ives.
Karsten Hopp 6d6f47
                 "Monty Python and the Holy Grail" PYTHON (MONTY) PICTURES LTD
Karsten Hopp 6d6f47
Karsten Hopp 6d6f47
 /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net   \\\
Karsten Hopp 6d6f47
///        sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
Karsten Hopp 6d6f47
\\\  an exciting new programming language -- http://www.Zimbu.org        ///
Karsten Hopp 6d6f47
 \\\            help me help AIDS victims -- http://ICCF-Holland.org    ///