Menu

#164 forward search does not keep position

closed-fixed
None
5
2003-10-10
2003-07-02
No

forward search (the ability to jump to a certain
position in a dvi-file) does not keep the position
(button k), at least not for me.

Discussion

  • Stefan Ulrich

    Stefan Ulrich - 2003-07-02
    • assigned_to: nobody --> stefanulrich
     
  • Stefan Ulrich

    Stefan Ulrich - 2003-07-02

    Logged In: YES
    user_id=177175

    > forward search (the ability to jump to a certain
    > position in a dvi-file) does not keep the position

    I did this scrolling on purpose, to bring the target of the
    search back into focus when it's off, otherwise one might
    not see anything. So I decided to treat forward search as a
    request of the user `view the text in this certain region',
    as if the user would scroll to the region.

    Maybe it does `too much' and scroll the page also when the
    location is already visible? (In that case, I'd like to send
    you a patch that outputs some more debugging information).

    Or should xdvi not scroll at all if `keep-position' is
    active? Maybe do something different, like show an arrow if
    the position is off?

     
  • Anonymous

    Anonymous - 2003-07-02

    Logged In: YES
    user_id=810188

    I use forward search for - well - the obvious: to navigate
    in a large
    document. All pages in my document are formatted the same
    way, so that extra
    scrolling is annoying.

    Nevertheless, you have a point here.

    > to bring the target of the search back into focus when
    it's off, otherwise
    > one might not see anything.

    Mmh, I'm not sure about the right (read: the most intuitive)
    way, but in my
    opinion, the (forced) extra scrolling is the wrong.

    > Or should xdvi not scroll at all if `keep-position' is
    > active?

    That is what I did expect.

    > Maybe do something different, like show an arrow if the
    position is off?

    Maybe. But don't you put a lot of work into xdvik anyway?

     
  • Stefan Ulrich

    Stefan Ulrich - 2003-07-02

    Logged In: YES
    user_id=177175

    > All pages in my document are formatted the same
    > way, so that extra scrolling is annoying.

    so maybe it is really scrolling too much? Would the
    upper-left corner of the `highlighted' rectangular region
    also be visible without scrolling? (Plus a small offset of
    about 25 pixels - maybe that offset too large?)

    I'll consider preventing scrolling if the `keep' flag is
    active, but this might be an independent problem.

     
  • Anonymous

    Anonymous - 2003-07-09

    Logged In: YES
    user_id=810188

    BTW, the same problem happens if you go to another page by
    clicking on the page list.

    If you think that keep position is a problem in connection
    with wide jumps in the document, maybe you should provide
    two modes of keep position: The regular one and an "really,
    really keep the position"

     
  • Stefan Ulrich

    Stefan Ulrich - 2003-07-09

    Logged In: YES
    user_id=177175

    > BTW, the same problem happens if you go to another page by
    > clicking on the page list.

    Indeed, but that's another bug; all occurrences of `home);'
    in pagesel.c need to be replaced by `resource.keep_flag ?
    NULL : home);'. Will fix this ASAP.

    > If you think that keep position is a problem in connection
    > with wide jumps in the document

    No, it's not related to distance; my argument with forward
    search was that we need some way to indicate the target of
    the forward search even when `keep' is active, else the user
    might think forward search didn't work at all. One
    possibility to do this is to scroll, another (probably
    cleaner) way is to indicate the location if it's outside the
    visible area with an arrow or something.

    Your report also seems to show that xdvi generally scrolls
    too much (even if the target point is already visible). I've
    started playing around with the offsets (they are a bit
    large), but haven't finished yet. I'll send another followup
    if it's finished, maybe you can then try it again to see if
    it still happens.

    If you'd like a quick fix now, you could change the
    following lines in `scroll_page_if_needed', file x_util.c:

    Position drawing_x, drawing_y, drawing_h, clip_x,
    clip_y, clip_h, clip_w;
    int test_scroll, need_v_scroll = 0, need_h_scroll = 0;
    Boolean reset_autoscroll = False;

    by:

    Position drawing_x, drawing_y, drawing_h, clip_x,
    clip_y, clip_h, clip_w;
    int test_scroll, need_v_scroll = 0, need_h_scroll = 0;
    Boolean reset_autoscroll = False;

    if (resource.keep_flag)
    return;

    and recompile.

     
  • Anonymous

    Anonymous - 2003-07-29

    Logged In: YES
    user_id=810188

    Unfortunately, your workaround does not work. I changed it into

    if (resource.keep_flag){
    fprintf(stderr, "X");
    return;
    }

    which shows that it takes the return every time. But if the
    target location is on another page then the position is not
    kept. (If the target loation is on the same page then the
    position is kept - with or without the workaround.)

     
  • Stefan Ulrich

    Stefan Ulrich - 2003-07-29

    Logged In: YES
    user_id=177175

    > But if the target location is on another page then the
    position
    > is not kept.

    Oops, you're right - there's another (actually 2 similar)
    goto_page(test_page, home);
    in dvi-draw.c which needs to be replaced by
    goto_page(test_page, resource.keep_flag ? NULL : home);

    (I'm rarely testing with shrink larger than page - should
    definitely start doing that ...)

    So that problem was completely unrelated to the `scrolling
    too much' issue.

     
  • Anonymous

    Anonymous - 2003-07-29

    Logged In: YES
    user_id=810188

    for sure, you mean 1x test_page and 1x best_page, do you?

     
  • Stefan Ulrich

    Stefan Ulrich - 2003-07-29

    Logged In: YES
    user_id=177175

    > for sure, you mean 1x test_page and 1x best_page, do you?

    Yup, one is for hyperlinks, the other for source specials.

     
  • Anonymous

    Anonymous - 2003-10-10

    Logged In: YES
    user_id=810188

    Oh, I've seen that this bug is still open.

    Your changes work, forward search keeps position now.

     
  • Stefan Ulrich

    Stefan Ulrich - 2003-10-10

    Logged In: YES
    user_id=177175

    > Your changes work, forward search keeps position now.
    Thanks for confirming this. I also left it open since
    there's still a few problems with scroll_if_needed
    (sometimes scrolls too much) but I guess I'd rather open a
    new bug for this ;-)

     
  • Stefan Ulrich

    Stefan Ulrich - 2003-10-10
    • status: open --> closed-fixed
     

Log in to post a comment.