Mercurial > vim
comparison src/gui_gtk_x11.c @ 3014:342b17608967 v7.3.279
updated for version 7.3.279
Problem: With GTK, when gvim is full-screen and a tab is opened and using a
specific monitor configuration the window is too big.
Solution: Adjust the window size like on MS-Windows. (Yukihiro Nakadaira)
author | Bram Moolenaar <bram@vim.org> |
---|---|
date | Wed, 10 Aug 2011 17:44:45 +0200 |
parents | 7653420fdc45 |
children | 72528c5eb87e |
comparison
equal
deleted
inserted
replaced
3013:655bb25912e9 | 3014:342b17608967 |
---|---|
3898 if (gui.mainwin != NULL) | 3898 if (gui.mainwin != NULL) |
3899 gtk_window_unmaximize(GTK_WINDOW(gui.mainwin)); | 3899 gtk_window_unmaximize(GTK_WINDOW(gui.mainwin)); |
3900 } | 3900 } |
3901 | 3901 |
3902 /* | 3902 /* |
3903 * Called when the font changed while the window is maximized. Compute the | |
3904 * new Rows and Columns. This is like resizing the window. | |
3905 */ | |
3906 void | |
3907 gui_mch_newfont() | |
3908 { | |
3909 int w, h; | |
3910 | |
3911 gtk_window_get_size(GTK_WINDOW(gui.mainwin), &w, &h); | |
3912 w -= get_menu_tool_width(); | |
3913 h -= get_menu_tool_height(); | |
3914 gui_resize_shell(w, h); | |
3915 } | |
3916 | |
3917 /* | |
3903 * Set the windows size. | 3918 * Set the windows size. |
3904 */ | 3919 */ |
3905 void | 3920 void |
3906 gui_mch_set_shellsize(int width, int height, | 3921 gui_mch_set_shellsize(int width, int height, |
3907 int min_width UNUSED, int min_height UNUSED, | 3922 int min_width UNUSED, int min_height UNUSED, |
4407 gui.wide_font = NULL; | 4422 gui.wide_font = NULL; |
4408 } | 4423 } |
4409 | 4424 |
4410 if (gui_mch_maximized()) | 4425 if (gui_mch_maximized()) |
4411 { | 4426 { |
4412 int w, h; | |
4413 | |
4414 /* Update lines and columns in accordance with the new font, keep the | 4427 /* Update lines and columns in accordance with the new font, keep the |
4415 * window maximized. */ | 4428 * window maximized. */ |
4416 gtk_window_get_size(GTK_WINDOW(gui.mainwin), &w, &h); | 4429 gui_mch_newfont(); |
4417 w -= get_menu_tool_width(); | |
4418 h -= get_menu_tool_height(); | |
4419 gui_resize_shell(w, h); | |
4420 } | 4430 } |
4421 else | 4431 else |
4422 { | 4432 { |
4423 /* Preserve the logical dimensions of the screen. */ | 4433 /* Preserve the logical dimensions of the screen. */ |
4424 update_window_manager_hints(0, 0); | 4434 update_window_manager_hints(0, 0); |