Bug 328779 - kmag: recursive magnification of itself and its magnified view
Summary: kmag: recursive magnification of itself and its magnified view
Status: RESOLVED FIXED
Alias: None
Product: kmag
Classification: Applications
Component: general (show other bugs)
Version: 1.0
Platform: Ubuntu Linux
: NOR minor
Target Milestone: ---
Assignee: sarang
URL:
Keywords:
: 347875 (view as bug list)
Depends on:
Blocks:
 
Reported: 2013-12-14 00:58 UTC by Magdalen Berns
Modified: 2015-05-21 09:03 UTC (History)
3 users (show)

See Also:
Latest Commit:
Version Fixed In: 4.14.2


Attachments
screenshot (57.53 KB, image/png)
2013-12-14 00:58 UTC, Magdalen Berns
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Magdalen Berns 2013-12-14 00:58:22 UTC
Created attachment 84079 [details]
screenshot

Apologies if this bug has been filed somewhere already. I have not posted here before so I may have missed it in my search of current bugs. 

$ kmag --version
Qt: 4.8.4
KDE Development Platform: 4.11.2
KMagnifier: 1.0
Comment 1 Christoph Feck 2013-12-16 21:18:41 UTC

*** This bug has been marked as a duplicate of bug 108068 ***
Comment 2 Magdalen Berns 2013-12-16 22:13:30 UTC
Sorry, but that bug has nothing to do with this one.
Comment 3 Christoph Feck 2013-12-28 00:36:28 UTC
What do you kmag expect to do when you zoom in the part of the screen that is covered by kmag?
Comment 4 Magdalen Berns 2013-12-29 21:49:51 UTC
That is quite a big question. 

The question implies we know that the user wants to see the part of the screen blocked by kmag which is a fair assumption, since the tool should not block parts of the screen.

However, I suspect we cannot assume that this part of the screen is what they user will want to magnify since kmag preferences themselves are likely to be too small to read for a low vision user to make out without the aid of a magnifier, but that is something which seems to be an issue in itself (i.e. a seperate bug to this one)

Ultimately the recursive 'magnification' is not a duplicate of the bug though it may well be a symptom of it I think this because the magnified desktop view recursively shrinks inside itself which seems more due to the magnifiers inability to determine whether it is magnifying a view which has already been magnified or not (I suspect so anyway.) rather than because it struggles to magnify a part of the desktop blocked by itself.

Hope that clarifies.
Comment 5 Christoph Feck 2013-12-29 22:20:16 UTC
So what do you suggest to resolve this bug? Should it replace its own content with a static grey (window background) color in the zoomed view?
Comment 6 Christoph Feck 2013-12-29 23:12:38 UTC
In case you can test a patch:

diff --git a/kmagzoomview.cpp b/kmagzoomview.cpp
index 25b0088..5f2209b 100644
--- a/kmagzoomview.cpp
+++ b/kmagzoomview.cpp
@@ -970,6 +970,15 @@ void KMagZoomView::grabFrame()
   if (m_colormode != 0)
     m_coloredPixmap = QPixmap::fromImage(ColorSim::recolor(m_coloredPixmap.toImage(), m_colormode));
 
+  // erase background covered by kmag view
+  QPainter p(&m_coloredPixmap);
+  QRect viewRect = rect();
+  viewRect.translate(mapTo(window(), QPoint(0, 0)));
+  viewRect.translate(-selRect.topLeft());
+  viewRect.translate(window()->geometry().topLeft());
+  p.fillRect(viewRect, palette().dark());
+  p.end();
+
   QRect r = m_zoomMatrix.mapRect(m_coloredPixmap.rect());
   // call repaint to display the newly grabbed image
   horizontalScrollBar()->setPageStep(r.width());
Comment 7 Christoph Feck 2013-12-29 23:27:05 UTC
Patch has issues with pull-down and pop-up menus (or even other windows) that overlap the view; they will not be zoomed. This will be not easy to fix, do not expect me to do it. It is not really a bug to begin with.

You can use the KWin compositor zoom effects, which avoids this and bug 108068, but they do not offer all options of KMag.
Comment 8 Joshua Hudson 2014-04-29 22:53:02 UTC
The reason I got here is I was looking for a way to zoom a program designed for much lower DPI than modern monitors have and don't know how to upscale themselves.

Essentially I would run with the magnifier maximized and the window beneath it would appear at 2x zoom. It would work even better if I could stop mouse tracking.

As far as I can tell, KWin zoom doesn't work either.
Comment 9 Christoph Feck 2014-04-29 23:54:15 UTC
Joshua, please report the KWin zoom bugs separately. The KWin zoom effect works fine here.
Comment 10 Joshua Hudson 2014-04-30 02:46:11 UTC
OK it had something to do with desktop composting being off, in which case kwin zoom can't work.

Bug will have to stand as only kmag can be used with failsafe drivers.
Comment 11 Christoph Feck 2014-10-03 00:27:35 UTC
Git commit ec921f0a8b62660ec8c5ccdcd1d198b51272d2de by Christoph Feck.
Committed on 03/10/2014 at 00:25.
Pushed by cfeck into branch 'KDE/4.14'.

Prevent recursive zooming
FIXED-IN: 4.14.2

M  +23   -0    kmagzoomview.cpp

http://commits.kde.org/kmag/ec921f0a8b62660ec8c5ccdcd1d198b51272d2de
Comment 12 Christoph Feck 2015-05-21 09:03:39 UTC
*** Bug 347875 has been marked as a duplicate of this bug. ***