From owner-freebsd-ports@FreeBSD.ORG Mon Apr 27 09:49:58 2009 Return-Path: Delivered-To: FreeBSD-ports@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 9DCAB106566B for ; Mon, 27 Apr 2009 09:49:58 +0000 (UTC) (envelope-from lstewart@freebsd.org) Received: from lauren.room52.net (lauren.room52.net [210.50.193.198]) by mx1.freebsd.org (Postfix) with ESMTP id 2A5368FC08 for ; Mon, 27 Apr 2009 09:49:57 +0000 (UTC) (envelope-from lstewart@freebsd.org) Received: from lstewart.caia.swin.edu.au (lstewart.caia.swin.edu.au [136.186.229.95]) (authenticated bits=0) by lauren.room52.net (8.14.3/8.14.3) with ESMTP id n3R9VTOA074551 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO) for ; Mon, 27 Apr 2009 19:31:30 +1000 (EST) (envelope-from lstewart@freebsd.org) Message-ID: <49F57B6C.30703@freebsd.org> Date: Mon, 27 Apr 2009 19:31:24 +1000 From: Lawrence Stewart User-Agent: Thunderbird 2.0.0.21 (X11/20090412) MIME-Version: 1.0 To: FreeBSD-ports@freebsd.org Content-Type: multipart/mixed; boundary="------------060806070303010300070900" X-Spam-Status: No, score=-2.0 required=5.0 tests=AWL,BAYES_00,SPF_SOFTFAIL autolearn=disabled version=3.2.5 X-Spam-Checker-Version: SpamAssassin 3.2.5 (2008-06-10) on lauren.room52.net Cc: Subject: Minor fix for KDE 4.2.2 Konsole text selection regression X-BeenThere: freebsd-ports@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Porting software to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 27 Apr 2009 09:49:58 -0000 This is a multi-part message in MIME format. --------------060806070303010300070900 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Hi All, The upgrade from KDE 4.2.1 to 4.2.2 introduced a small but annoying regression into the Konsole app. Double click text selection no longer works correctly. The bug is documented here: https://bugs.kde.org/show_bug.cgi?id=189651 The attached patch can be stuck in the files directory of the x11/kdebase4 port to fix the issue until KDE ships an update. Cheers, Lawrence --------------060806070303010300070900 Content-Type: text/plain; name="patch-konsole_text_selection_fix_bug189651" Content-Transfer-Encoding: 7bit Content-Disposition: inline; filename="patch-konsole_text_selection_fix_bug189651" Index: TerminalDisplay.cpp =================================================================== --- ../apps/konsole/src/TerminalDisplay.cpp (.../4.2.2/kdebase/apps/konsole/src/TerminalDisplay.cpp) (revision 959808) +++ ../apps/konsole/src/TerminalDisplay.cpp (.../4.2.1/kdebase/apps/konsole/src/TerminalDisplay.cpp) (revision 959808) @@ -2172,12 +2155,11 @@ _wordSelectionMode = true; // find word boundaries... - QChar selClass = charClass(_image[i].character); { // find the start of the word int x = bgnSel.x(); while ( ((x>0) || (bgnSel.y()>0 && (_lineProperties[bgnSel.y()-1] & LINE_WRAPPED) )) - && charClass(_image[i-1].character) == selClass ) + && !isCharBoundary(_image[i-1].character) ) { i--; if (x>0) @@ -2196,7 +2178,7 @@ i = loc( endSel.x(), endSel.y() ); x = endSel.x(); while( ((x<_usedColumns-1) || (endSel.y()<_usedLines-1 && (_lineProperties[endSel.y()] & LINE_WRAPPED) )) - && charClass(_image[i+1].character) == selClass ) + && !isCharBoundary(_image[i+1].character) ) { i++; if (x<_usedColumns-1) @@ -2350,7 +2332,16 @@ return QWidget::focusNextPrevChild( next ); } +// Returns true upon a word boundary +// TODO determine if the below charClass() is actually required +bool TerminalDisplay::isCharBoundary(QChar qch) const +{ + if ( _wordCharacters.contains(qch, Qt::CaseInsensitive) ) return true; + if ( qch.isSpace() ) return true; + return false; +} + QChar TerminalDisplay::charClass(QChar qch) const { if ( qch.isSpace() ) return ' '; Index: TerminalDisplay.h =================================================================== --- ../apps/konsole/src/TerminalDisplay.h (.../4.2.2/kdebase/apps/konsole/src/TerminalDisplay.h) (revision 959808) +++ ../apps/konsole/src/TerminalDisplay.h (.../4.2.1/kdebase/apps/konsole/src/TerminalDisplay.h) (revision 959808) @@ -566,6 +563,9 @@ // - Other characters (returns the input character) QChar charClass(QChar ch) const; + // Returns true upon a word boundary + bool isCharBoundary(QChar ch) const; + void clearImage(); void mouseTripleClickEvent(QMouseEvent* ev); --------------060806070303010300070900--