Bug 129270 - zoom guidlines remain as phantoms when switching mouse modes with F-keys.
Summary: zoom guidlines remain as phantoms when switching mouse modes with F-keys.
Status: RESOLVED FIXED
Alias: None
Product: kst
Classification: Applications
Component: general (show other bugs)
Version: 1.x
Platform: unspecified Linux
: NOR normal
Target Milestone: ---
Assignee: kst
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2006-06-16 20:12 UTC by Matthew Truch
Modified: 2006-06-17 01:42 UTC (History)
0 users

See Also:
Latest Commit:
Version Fixed In:


Attachments
Proposed patch (1.27 KB, patch)
2006-06-16 23:41 UTC, Andrew Walker
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Matthew Truch 2006-06-16 20:12:54 UTC
Version:           1.3.0_svn_528442 (using KDE KDE 3.5.2)
OS:                Linux

Steps to reproduce.

1. Place the mouse over a plot.  Make sure you are in XY zoom mode (press F2).  
2. Press F3 to enter X zoom mode.
3. Move mouse around within plot.
4. Press F2 to leave X zoom mode (back to XY zoom mode).

The exact same is true for F4 (Y zoom mode).  Notice how the guidelines from X zoom mode remain displayed.  If you move the mouse outside the plot (into another plot or elsewhere), the phantom guidelines disappear.
Comment 1 Andrew Walker 2006-06-16 20:20:13 UTC
A similar problem (but probably more eveident) also exists.

STEPS TO REPRODUCE:
Start Kst
Create a plot
Switch to x mouse zoom mode
Bring up any dialog from within Kst
Click on the titlebar of the dialog and drag it over the plot area

RESULTS:
A trail of the guideline follows the mouse
Comment 2 George Staikos 2006-06-16 21:46:14 UTC
  Known issue and mentioned in the feature request for this feature.  It will 
be fixed once kst2dplot is fixed.
Comment 3 Andrew Walker 2006-06-16 23:41:02 UTC
Created attachment 16647 [details]
Proposed patch

Fixes both the problems described.
Comment 4 George Staikos 2006-06-17 01:06:48 UTC
The patch looks fine.  Please don't split the updateXYGuideline line though.  
It makes grep harder to work with.  I'm not sure this is all the cases of 
this problem.  I had identified several when I last worked on it.
Comment 5 Andrew Walker 2006-06-17 01:42:58 UTC
SVN commit 552204 by arwalker:

BUG:129270 Ensure no phantom guidelines are created when switching modes.

 M  +4 -2      kst2dplot.cpp  
 M  +1 -1      ksttoplevelview.cpp  


--- trunk/extragear/graphics/kst/src/libkstapp/kst2dplot.cpp #552203:552204
@@ -2383,8 +2383,10 @@
 
     KstMouseModeType gzType = globalZoomType();
     if (view && (gzType == X_ZOOMBOX || gzType == Y_ZOOMBOX)) {
-      updateXYGuideline(view, QPoint(-1, -1), view->mapFromGlobal(QCursor::pos()), GetPlotRegion(), gzType);
-      _mouse.lastGuideline = view->mapFromGlobal(QCursor::pos());
+      if (GetPlotRegion().contains(_mouse.tracker)) {
+        updateXYGuideline(view, QPoint(-1, -1), view->mapFromGlobal(QCursor::pos()), GetPlotRegion(), gzType);
+        _mouse.lastGuideline = view->mapFromGlobal(QCursor::pos());
+      }
     }
   }
 }
--- trunk/extragear/graphics/kst/src/libkstapp/ksttoplevelview.cpp #552203:552204
@@ -240,10 +240,10 @@
   if (_mode == LayoutMode && v != LayoutMode) {
     recursively<bool>(&KstViewObject::setSelected, false);
     clearFocus();
-    paint(KstPainter::P_PAINT);
   } else if (_mode == DisplayMode && v != DisplayMode) {
     recursively<bool>(&KstViewObject::setMaximized, false);
   }
+  paint(KstPainter::P_PAINT);
 
   _mode = v;