Redraw core select menu after selection

Chris Young chris.young at unsatisfactorysoftware.co.uk
Sun Feb 26 11:56:58 GMT 2012


On Sun, 26 Feb 2012 11:08:40 +0000 (GMT), Michael Drake wibbled on for an age:

> In article
> <OUT-4F4A0E39.MD-1.4.17.chris.young at unsatisfactorysoftware.co.uk>,
>    Chris Young <chris.young at unsatisfactorysoftware.co.uk> wrote:
> > Hi
> 
> > Where is the code to redraw the core select menu, after the user has
> > selected something?  I can see where it clears the menu area (line 220
> > of html_interaction.c), but it doesn't redraw the original form item
> > at that point.  It is getting redrawn somewhere else though, as I'm
> > getting artifacts from old redraws over the area, but it doesn't
> > update as it should.
> 
> In render/form.c, in at the end of form_select_process_selection() it
> calls html_redraw_a_box() to redraw the actual select form element box
> with the new text.

Thanks.  I'm getting the correct values through to my redraw function,
and I can see the box is slightly above where the request to clear the
menu operates (so that seems to be correct).  As the call to
browser_window_redraw is therefore almost identical, it looks as if
for some reason this isn't drawing (or is not drawing into my bitmap
at 0,0), however browser_window_redraw is returning true.

If I select 20 results from Google's advanced search, it tries to draw
the area at 354,325 with size 368,20.  browser_window_redraw gets
called with values -354,-325 and clip rectangle 0,0,300,20 (and again
for the remaining pixels)

When NetSurf clears the menu afterwards, it tries to draw the area at
352,347 with size 372,90.  browser_window_redraw gets called with
vlues -352,-347 and clip rectangle 0,0,300,90 (and again for the
remaining pixels.

Clearing the menu appears to happen twice, but I doubt that is
relevant.

It is only the redraw of the select form that isn't working (and if I
expand the menu clear so it redraws the area above, it redraws it
fine), animated GIFs, text areas, radio buttons etc are all drawing
perfectly when modified.  It seems to be something particular to that
html_redraw_a_box call.  Any ideas?

Chris



More information about the netsurf-dev mailing list