To:
[email protected]
Subject: Patch 5.7a.008
Fcc: outbox
From: Bram Moolenaar <
[email protected]>
------------
Patch 5.7a.008
Problem: GTK GUI: When using CTRL-L the screen is redrawn twice, causing
trouble for bold characters. Also happens when moving with the
scrollbar. Best seen when 'writedelay' is non-zero.
When starting the GUI with ":gui" the screen is redrawn once with
the wrong colors.
Solution: Only set the geometry hints when the window size really changed.
This avoids setting it each time the scrollbar is forcefully
redrawn.
Don't redraw in expose_event() when gui.starting is still set.
Files: src/gui_gtk_x11.c
*** ../vim-5.7a.7/src/gui_gtk_x11.c Sun Jun 18 15:30:48 2000
--- src/gui_gtk_x11.c Tue Jun 20 15:08:20 2000
***************
*** 342,347 ****
--- 342,351 ----
static gint
expose_event(GtkWidget * widget, GdkEventExpose * event)
{
+ /* Skip this when the GUI isn't set up yet, will redraw later. */
+ if (gui.starting)
+ return FALSE;
+
out_flush(); /* make sure all output has been processed */
gui_redraw(event->area.x, event->area.y,
event->area.width, event->area.height);
***************
*** 1657,1677 ****
#ifdef USE_GEOMETRY_FOR_HINTS
GdkGeometry geometry;
GdkWindowHints geometry_mask;
/* This also needs to be done when the main window isn't there yet,
* otherwise the hints don't work. */
width = gui_get_base_width();
height = gui_get_base_height();
! geometry_mask = GDK_HINT_BASE_SIZE|GDK_HINT_RESIZE_INC|GDK_HINT_MIN_SIZE;
! geometry.width_inc = gui.char_width;
! geometry.height_inc = gui.char_height;
! geometry.base_width = width;
! geometry.base_height = height;
! geometry.min_width = width + MIN_COLUMNS * gui.char_width;
! geometry.min_height = height + MIN_LINES * gui.char_height;
! gtk_window_set_geometry_hints(GTK_WINDOW(gui.mainwin), gui.formwin,
! &geometry, geometry_mask);
#else
XSizeHints size_hints;
--- 1661,1697 ----
#ifdef USE_GEOMETRY_FOR_HINTS
GdkGeometry geometry;
GdkWindowHints geometry_mask;
+ static int old_width = 0;
+ static int old_height = 0;
+ static int old_char_width = 0;
+ static int old_char_height = 0;
/* This also needs to be done when the main window isn't there yet,
* otherwise the hints don't work. */
width = gui_get_base_width();
height = gui_get_base_height();
! /* Avoid an expose event when the size didn't change. */
! if (width != old_width
! || height != old_height
! || gui.char_width != old_char_width
! || gui.char_height != old_char_height)
! {
! geometry_mask =
! GDK_HINT_BASE_SIZE|GDK_HINT_RESIZE_INC|GDK_HINT_MIN_SIZE;
! geometry.width_inc = gui.char_width;
! geometry.height_inc = gui.char_height;
! geometry.base_width = width;
! geometry.base_height = height;
! geometry.min_width = width + MIN_COLUMNS * gui.char_width;
! geometry.min_height = height + MIN_LINES * gui.char_height;
! gtk_window_set_geometry_hints(GTK_WINDOW(gui.mainwin), gui.formwin,
! &geometry, geometry_mask);
! old_width = width;
! old_height = height;
! old_char_width = gui.char_width;
! old_char_height = gui.char_height;
! }
#else
XSizeHints size_hints;
*** ../vim-5.7a.7/src/version.c Fri Jun 23 10:46:44 2000
--- src/version.c Fri Jun 23 10:47:22 2000
***************
*** 439,440 ****
--- 439,442 ----
{ /* Add new patch number below this line */
+ /**/
+ 8,
/**/
--
hundred-and-one symptoms of being an internet addict:
96. On Super Bowl Sunday, you followed the score by going to the
Yahoo main page instead of turning on the TV.
/-/-- Bram Moolenaar ---
[email protected] ---
http://www.moolenaar.net --\-\
\-\-- Vim:
http://www.vim.org ---- ICCF Holland:
http://www.vim.org/iccf --/-/