By default, Bugzilla does not search the list of RESOLVED bugs.
You can force it to do so by putting the upper-case word ALL in front of your search query, e.g.: ALL tdelibs
We recommend searching for bugs this way, as you may discover that your bug has already been resolved and fixed in a later release.
Bug 2597 - konsole mouse-scrolling support for 'less', 'vi', ...
Summary: konsole mouse-scrolling support for 'less', 'vi', ...
Status: RESOLVED FIXED
Alias: None
Product: TDE
Classification: Unclassified
Component: tdeutils (show other bugs)
Version: R14.1.x [Trinity]
Hardware: Other Linux
: P5 enhancement
Assignee: Michele Calgaro
URL:
Depends on:
Blocks: R14.1.0
  Show dependency treegraph
 
Reported: 2016-02-22 13:08 CST by ThoMaus
Modified: 2016-03-14 11:52 CDT (History)
4 users (show)

See Also:
Compiler Version:
TDE Version String: 14.0.2
Application Version: 14.0.2
Application Name: trinity-konsole


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description ThoMaus 2016-02-22 13:08:12 CST
most Xterminal implementations detect, if an application like 'less', 'vi', etc. switch to the alternate screen (essentially a curses mode with a fixed screen without scrolling history). Mouse scrolling events are then translated to synthetic cursors up+down key presses.

The DIFF for the KDE3-konsole is found here:

https://websvn.kde.org/trunk/KDE/kdebase/apps/konsole/src/TerminalDisplay.cpp?r1=786780&r2=786779&pathrev=786780

Probably it should be applicable without much collisions.
Comment 1 Michele Calgaro 2016-02-23 04:43:09 CST
> Probably it should be applicable without much collisions.

I think that svn diff refers to KDE4 source code, since there is no such file in Konsole in TDE.
Anyhow I think it should be possible to analyze the KDE4 code for differences and then use the necessary bits to get the same result for TDE.

Not only scrolling with the mouse should be supported, also using the normal keyboard shortcuts for scrolling should behave correctly.
Comment 2 Michele Calgaro 2016-02-23 04:47:33 CST
yes, definitely KDE 4 code, I just checked :-)
Comment 3 ThoMaus 2016-02-23 08:29:39 CST
(In reply to Michele Calgaro from comment #2)
> yes, definitely KDE 4 code, I just checked :-)

Ooops, sorry -- I'd should have checked myself (it was late + lazy ;-)
The feature actually first appeared in KDE4.

I have cloned the TDE GIT and had a look:

In "main/tdebase/konsole/konsole/TEWidget.cpp" you'll find the following
code -- I've added a comment below to indicate where the logical code of the patch needs to be applied (of course not literally):

<code>

void TEWidget::wheelEvent( TQWheelEvent* ev )
{
  if (ev->orientation() != Qt::Vertical)
    return;

  if ( mouse_marks )
// ThoMaus: HERE the patch on the logical level applies
    TQApplication::sendEvent(scrollbar, ev);
  else
  {
    TQPoint tL  = contentsRect().topLeft();
    int    tLx = tL.x();
    int    tLy = tL.y();
    TQPoint pos = TQPoint((ev->x()-tLx-bX)/font_w,(ev->y()-tLy-bY)/font_h);
    emit mouseSignal( ev->delta() > 0 ? 4 : 5, pos.x() + 1, pos.y() + 1 +scrollbar->value() -scrollbar->maxValue() );
  }
}

</code>

Hope, that helps ...

Not being versed in (T)Qt I cannot code this myself, but I'm willing to test changes.
Comment 4 Michele Calgaro 2016-03-14 11:52:12 CDT
Added to main trunk in commit 1c64345.
This will not be added to r14.0.x being a new feature.

Small change but tricky to get it right in all situations. The number of scrolled lines is selectable in the TDE Control Center -> Peripherals -> Mouse -> Advanced -> "Mouse wheel scrolls by" parameter.