diff options
author | Josh Morman <jmorman@perspectalabs.com> | 2019-08-02 12:13:42 -0400 |
---|---|---|
committer | Marcus Müller <marcus@hostalia.de> | 2019-08-07 21:46:21 +0200 |
commit | a44a511a35fc78f6aa7ecf067507c921a2865788 (patch) | |
tree | 1032bef50a3d98f9be3274ce1db5f24b8006c44f | |
parent | cdda3cace38d84c8b0203d33d5180bc68366434f (diff) |
grc: prevent scrolling to top of canvas
GRC was scrolling to the top of the canvas when clicking.
This occurs when clicking into the console or search tree then back into the canvas, the view is reset to the top left.
Commented out one line in _handle_mouse_button_press in DrawingArea.py -
makes the problem go away.
Fixes #2660
-rw-r--r-- | grc/gui/DrawingArea.py | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/grc/gui/DrawingArea.py b/grc/gui/DrawingArea.py index 007c21e290..d4ebc3b7b0 100644 --- a/grc/gui/DrawingArea.py +++ b/grc/gui/DrawingArea.py @@ -119,7 +119,12 @@ class DrawingArea(Gtk.DrawingArea): """ Forward button click information to the flow graph. """ - self.grab_focus() + # The following line causes the canvas to reset position to 0,0 + # when changing focus from the console or block search back to + # the canvas + # Removing this line leaves the canvas alone when focus changes + # self.grab_focus() + self.ctrl_mask = event.get_state() & Gdk.ModifierType.CONTROL_MASK self.mod1_mask = event.get_state() & Gdk.ModifierType.MOD1_MASK self.button_state[event.button] = True |