[PATCH 1/3] Allow selecting current frame twice consecutively



Hello,

Normally when a user selects a frame in the call stack view, two main
things happens:

    1/ The where-marker (yellow arrow in the margin showing the next
    statement to be executed) is positioned and the source view is
    properly scrolled so that the where-marker is visible.

    2/  The local variables and function arguments are updated for the
    current frame in the local variables' view.

Once a frame is already selected, when the user double-clicks on the
frame's row in the call stack widget, nothing happens; neither 1/ nor
2/ is performed.  This is an optimization I did because 2/ can be
costly.

But then it occurred to me that, if the user selects a frame, then
scrolls the source view around to read the source code up to a point
where the where-marker becomes non-visible, she can be willing to
double click the current frame again just to have the source view
scrolled properly again so that where-marker becomes visible again.

So this patch lets Nemiver do 1/ whenever the user double clicks on
the row of the current frame again.

Tested and applied to master.

From: Dodji Seketeli <dodji gnome org>
Date: Sun, 2 Oct 2011 20:54:32 +0200
Subject: [PATCH 1/3] Allow selecting current frame twice consecutively

	* src/persp/dbgperspective/nmv-dbg-perspective.cc
	(DBGPerspective::on_frame_selected_signal): If the current frame
	was previously selected, just set the "where-marker" again.
---
 src/persp/dbgperspective/nmv-dbg-perspective.cc |   13 ++++++++++---
 1 files changed, 10 insertions(+), 3 deletions(-)

diff --git a/src/persp/dbgperspective/nmv-dbg-perspective.cc b/src/persp/dbgperspective/nmv-dbg-perspective.cc
index 83b472b..8fbbe4b 100644
--- a/src/persp/dbgperspective/nmv-dbg-perspective.cc
+++ b/src/persp/dbgperspective/nmv-dbg-perspective.cc
@@ -2480,11 +2480,18 @@ DBGPerspective::on_frame_selected_signal (int /* a_index */,
 {
     LOG_FUNCTION_SCOPE_NORMAL_DD;
 
-    if (m_priv->current_frame == a_frame)
-        return;
-
     NEMIVER_TRY;
 
+    if (m_priv->current_frame == a_frame)
+    {
+        // So the user clicked on the frame to select it, even if we
+        // where already on it before.  That probably means that she
+        // has scrolled the source view a little bit, lost where the
+        // where-arrow was, and want to get it again.  So let's only
+        // set the where and bail out.
+        set_where (a_frame, /*a_do_scroll=*/true, /*a_try_hard=*/true);
+        return;
+    }
 
     m_priv->current_frame = a_frame;
 
-- 
1.7.6.2


-- 
		Dodji


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]