Commit 44ae8d78 authored by Gildas Bazin's avatar Gildas Bazin

* modules/gui/gtk/gnome.c, modules/gui/gtk/gtk.c: clean up the gtk/gnome
messages window regularly.
parent de6f151f
......@@ -2,7 +2,7 @@
* gnome.c : Gnome plugin for vlc
*****************************************************************************
* Copyright (C) 2000 VideoLAN
* $Id: gnome.c,v 1.11 2003/02/20 01:52:46 sigmunau Exp $
* $Id: gnome.c,v 1.12 2003/03/07 00:53:09 gbazin Exp $
*
* Authors: Samuel Hocevar <sam@zoy.org>
*
......@@ -378,6 +378,15 @@ static void Manage( intf_thread_t *p_intf )
p_intf->p_sys->p_sub->i_start = i_start;
vlc_mutex_unlock( p_intf->p_sys->p_sub->p_lock );
/* If the messages list becomes too big, just clean half of it. */
if( gtk_text_get_length( p_intf->p_sys->p_messages_text ) >
VLC_MSG_QSIZE * 1000 )
{
gtk_text_set_point( p_intf->p_sys->p_messages_text, 0 );
gtk_text_forward_delete( p_intf->p_sys->p_messages_text,
gtk_text_get_length( p_intf->p_sys->p_messages_text ) / 2 );
}
gtk_text_set_point( p_intf->p_sys->p_messages_text,
gtk_text_get_length( p_intf->p_sys->p_messages_text ) );
}
......
......@@ -2,7 +2,7 @@
* gtk.c : Gtk+ plugin for vlc
*****************************************************************************
* Copyright (C) 2000-2001 VideoLAN
* $Id: gtk.c,v 1.16 2003/02/20 01:52:46 sigmunau Exp $
* $Id: gtk.c,v 1.17 2003/03/07 00:53:09 gbazin Exp $
*
* Authors: Samuel Hocevar <sam@zoy.org>
*
......@@ -395,6 +395,15 @@ static int Manage( intf_thread_t *p_intf )
p_intf->p_sys->p_sub->i_start = i_start;
vlc_mutex_unlock( p_intf->p_sys->p_sub->p_lock );
/* If the messages list becomes too big, just clean half of it. */
if( gtk_text_get_length( p_intf->p_sys->p_messages_text ) >
VLC_MSG_QSIZE * 1000 )
{
gtk_text_set_point( p_intf->p_sys->p_messages_text, 0 );
gtk_text_forward_delete( p_intf->p_sys->p_messages_text,
gtk_text_get_length( p_intf->p_sys->p_messages_text ) / 2 );
}
gtk_text_set_point( p_intf->p_sys->p_messages_text,
gtk_text_get_length( p_intf->p_sys->p_messages_text ) );
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment