[Date Prev][Date Next] [Thread Prev][Thread Next]
[Thread Index]
[Date Index]
[Author Index]
Re: Refreshing windows as often as possible, but not too often
- From: Ben Laurie <ben algroup co uk>
- To: gtk-app-devel-list redhat com
- Subject: Re: Refreshing windows as often as possible, but not too often
- Date: Thu, 14 Oct 1999 22:31:47 +0100
rsmith@xs4all.nl wrote:
>
> On 9 Oct, Ben Laurie wrote:
> > This is probably a really stupid question, but here goes...
> >
> > For various reasons, which I'll go into if anyone cares, I'm writing a
> > Brooktree video capture prog for GTK. This works fine, but ... I have a
> > really irritating problem. Using a technique copied from, err, somewhere
> > (gnoghurt?), the way I do it is to make a pixmap the background of a
> > window, copy the current frame to the pixmap, and clear the window, with
> > gdk_window_clear(). I do this from an idle function, using
> > gtk_idle_add(). The snag is that it _really_ interferes with user
> > interaction. The mouse is like treacle, it takes ages to shut down,
> > window focus doesn't work, and so on.
>
> An idle function gets called in every iteration of the main loop. So
> copying the frame to the pixmap every time is bogging down the machine
> unnecesseraly.
>
> Maybe you can add some code to the idle fuction so that it only copies
> to the pixmap and refreshes the window if the image in the frame has
> changed? That way you refresh as often as is sensible (I mean, why draw
> the same image multiple times?) without bogging down the machine.
Actually, I've tried waiting for a fresh frame each time. Same deal.
Guess I can produce frames faster than X can eat them :-)
But, as you say, the problem is that the idle function is called when
the _client_ is idle. What I need is a function that gets called when
the _server_ is idle!
Cheers,
Ben.
--
http://www.apache-ssl.org/ben.html
"My grandfather once told me that there are two kinds of people: those
who work and those who take the credit. He told me to try to be in the
first group; there was less competition there."
- Indira Gandhi
[Date Prev][Date Next] [Thread Prev][Thread Next]
[Thread Index]
[Date Index]
[Author Index]