Bug 94330

Summary: action popup plays cat-and-mouse with mouse
Product: [Applications] klipper Reporter: Oswald Buddenhagen <ossi>
Component: generalAssignee: Esben Mose Hansen <kde>
Status: RESOLVED FIXED    
Severity: normal    
Priority: NOR    
Version: unspecified   
Target Milestone: ---   
Platform: Compiled Sources   
OS: Linux   
Latest Commit: Version Fixed In:
Attachments: ugly hack patch
klipper-cat-mouse.patch

Description Oswald Buddenhagen 2004-12-03 15:21:18 UTC
Version:            (using KDE Devel)
Installed from:    Compiled sources

... but, interestingly enough, the mouse is the cat. :)
after selecting a url, the popup comes up, but if i move the pointer over it, it just hides and re-appears at the current pointer position, effectively making a jump to the top right. one can still "win" by being fast enough. whatever.
Comment 1 Esben Mose Hansen 2005-02-05 22:39:17 UTC
I cannot reproduce this. Could you make a step-by-step, and tell me what options you have selected on the General tab? Thanks!
Comment 2 Oswald Buddenhagen 2005-02-06 21:59:14 UTC
popup @ mouse cursor
replay at selection from history
prevent empty clipboard
NOT ignore selection
separate clipboard and selection

rest seems irrelevant ...
Comment 3 Esben Mose Hansen 2005-02-06 22:21:05 UTC
> popup @ mouse cursor 
+ Selection non-QT application

Bingo. Thanks!

Could you tell me which application you select from?

Thinking............... done
Solution: found

I'll produce a patch, shortly: When action popup is showing, don't popup new action menu. That doesn't really work anyway.

Comment 4 Esben Mose Hansen 2005-02-24 22:15:31 UTC
Created attachment 9818 [details]
ugly hack patch

Well, the solution I thought up doesn't work. 

Under death threats ;-): Attaching a ugly hack. 

Caveats: When selecting the same string twice, the action won't get invoked the
second time.

The only way to fix this bug and avoid the former where possible would be to
track if the clipboard item originated from a broken application (that doesn't
reply to TIMESTAMP selection target request, should you care). That change is
way too big for KDE 3.4, and planned for KDE 4.0 anyway.
Comment 5 Esben Mose Hansen 2005-02-25 09:26:04 UTC
Hi,

would it be acceptable to commit 

http://bugs.kde.org/attachment.cgi?id=9818&action=view

to cure

Bug 94330: action popup plays cat-and-mouse with mouse

According to the reporter (who tested the patch), the actions part of Klipper 
is unusable without this patch.

There are no new i18n strings.



Created an attachment (id=9828)
klipper-cat-mouse.patch
Comment 6 Esben Mose Hansen 2005-02-27 20:17:49 UTC
CVS commit by esben: 

Only popup action selection if the clipboard item is different from the last.

BUGS: 94330


  M +7 -3      toplevel.cpp   1.173


--- kdebase/klipper/toplevel.cpp  #1.172:1.173
@@ -842,8 +842,12 @@ void KlipperWidget::checkClipData( bool 
         QString text;
         QTextDrag::decode( data, text );
+        const HistoryStringItem* topItem = dynamic_cast<const HistoryStringItem*>( history()->first() );
+        if ( !topItem || text != topItem->text() ) {
         if ( myURLGrabber->checkNewData( text ) )
         {
             return; // don't add into the history
         }
+
+        }
     }
 


Comment 7 Esben Mose Hansen 2005-02-27 20:20:08 UTC
CVS commit by esben: 

Backport fix to bug 94330: Only popup action selectio menu if the current clipboard contents are different from the last.

CCBUGS: 94330


  M +7 -3      toplevel.cpp   1.172.2.1


--- kdebase/klipper/toplevel.cpp  #1.172:1.172.2.1
@@ -842,8 +842,12 @@ void KlipperWidget::checkClipData( bool 
         QString text;
         QTextDrag::decode( data, text );
+        const HistoryStringItem* topItem = dynamic_cast<const HistoryStringItem*>( history()->first() );
+        if ( !topItem || text != topItem->text() ) {
         if ( myURLGrabber->checkNewData( text ) )
         {
             return; // don't add into the history
         }
+
+        }
     }