On Wed, Oct 25, 2006 at 05:36:52PM +0200, Magnus Holmgren <[EMAIL PROTECTED]> 
was heard to say:
> Package: aptitude
> Version: 0.4.3-1
> Severity: normal
> 
> (With minibuffer-style prompt on.)
> 
> For example, pressing C on a package [version] not in an official
> release causes the message "You can only view changelogs from official
> Debian packages" to appear on red background in the status line. That
> message doesn't seem to go away, except in some random cases. Also,
> after performing a searh (with / or \) and pressing enter, the cursor
> stays in the status line, so you have to press up arrow, down arrow,
> or tab go get back to the package list.

  I think I have a fix for the problem with messages not going away.
The problem with searches seems to be a side-effect of the problem
with messages (once there's a message showing up there, it looks like
the program wants to give it focus after the search is finished), so
they're both fixed with this patch.

  Daniel
Thu Oct 26 17:03:32 PDT 2006  Daniel Burrows <[EMAIL PROTECTED]>
  * Fix minibuffer-style messages so that they disappear at the next keystroke. 
(Closes: #395201)

    hunk ./src/ui.cc 2795
    +class self_destructing_layout : public vs_text_layout
    +{
    +protected:
    +  self_destructing_layout() : vs_text_layout()
    +  {
    +  }
    +
    +  self_destructing_layout(fragment *f) : vs_text_layout(f)
    +  {
    +  }
    +
    +public:
    +  bool handle_key(const key &k)
    +  {
    +    if(!vs_text_layout::focus_me() ||
    +       !vs_text_layout::handle_key(k))
    +      destroy();
    +
    +    return true;
    +  }
    +
    +  /** \brief Unlike vs_text_layouts, self-destructing widgets
    +   *  can always grab the focus.
    +   */
    +  bool focus_me()
    +  {
    +    return true;
    +  }
    +
    +  static ref_ptr<self_destructing_layout> create()
    +  {
    +    ref_ptr<self_destructing_layout> rval(new self_destructing_layout());
    +    rval->decref();
    +    return rval;
    +  }
    +
    +  static ref_ptr<self_destructing_layout> create(fragment *f)
    +  {
    +    ref_ptr<self_destructing_layout> rval(new self_destructing_layout(f));
    +    rval->decref();
    +    return rval;
    +  }
    +};
    +
    hunk ./src/ui.cc 2846
    -      vs_text_layout_ref l=vs_text_layout::create(msg);
    +      vs_text_layout_ref l = self_destructing_layout::create(msg);

Reply via email to