Skip to content
This repository

Pager tearing bug #1153

Merged
merged 1 commit into from over 2 years ago

2 participants

Prabhu Ramachandran Fernando Perez
Prabhu Ramachandran

This is an update to #1150. I've merged these changes with master as well and tested this on Linux and Windows XP 64 bit and it works fine. The tearing bug isn't completely gone but until we find a cleaner solution this at least makes the pager functional when used in the vsplit mode.

Fernando Perez
Owner

@prabhuramachandran, please simply rebase your branch onto master, so that we don't have criss-crossing of the history. Basically your PR should only show your own commits, and not the master merge. Let us know if you need a hand with the rebase details and we'll be happy to help.

Prabhu Ramachandran BUG: Scrolling pager in vsplit on Mac OSX tears.
On Mac OS X, scrolling the pager when it is split vertically causes the
help text to tear (i.e. the help text is unreadable).  This hack
attempts to make it a little better although the solution may not be
optimal at all.
811b745
Prabhu Ramachandran

@fperez, sorry about that, I've rebased and hope this is OK. Do let me know if I've messed anything up. Thanks.

Fernando Perez
Owner

I've also tested on ubuntu 11.10 and it works OK here. Since we had already tested the exact same logic yesterday on OSX, I'll go ahead and merge now. Thanks!

Fernando Perez fperez merged commit 811b745 into from December 14, 2011
Fernando Perez fperez closed this December 14, 2011
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Showing 1 unique commit by 1 author.

Dec 15, 2011
Prabhu Ramachandran BUG: Scrolling pager in vsplit on Mac OSX tears.
On Mac OS X, scrolling the pager when it is split vertically causes the
help text to tear (i.e. the help text is unreadable).  This hack
attempts to make it a little better although the solution may not be
optimal at all.
811b745
This page is out of date. Refresh to see the latest.
23  IPython/frontend/qt/console/console_widget.py
@@ -172,6 +172,13 @@ def __init__(self, parent=None, **kw):
172 172
         QtGui.QWidget.__init__(self, parent)
173 173
         LoggingConfigurable.__init__(self, **kw)
174 174
 
  175
+        # While scrolling the pager on Mac OS X, it tears badly.  The
  176
+        # NativeGesture is platform and perhaps build-specific hence
  177
+        # we take adequate precautions here.
  178
+        self._pager_scroll_events = [QtCore.QEvent.Wheel]
  179
+        if hasattr(QtCore.QEvent, 'NativeGesture'):
  180
+            self._pager_scroll_events.append(QtCore.QEvent.NativeGesture)
  181
+
175 182
         # Create the layout and underlying text widget.
176 183
         layout = QtGui.QStackedLayout(self)
177 184
         layout.setContentsMargins(0, 0, 0, 0)
@@ -364,17 +371,11 @@ def eventFilter(self, obj, event):
364 371
             QtGui.qApp.sendEvent(obj, QtGui.QDragLeaveEvent())
365 372
             return True
366 373
 
367  
-        # Handle scrolling of the vsplit pager. This hack attempts to solve the
368  
-        # problem of tearing of the pager window's help text on Mac OS X.  This
369  
-        # happens with PySide and PyQt. This fix isn't perfect but makes the
370  
-        # pager more usable.
371  
-
372  
-        # FIXME: this line, on qt 4.8.5, crashes b/c NativeGesture is not
373  
-        # available.   Disabling for now, until we sort out a cleaner solution.
374  
-        # See https://github.com/ipython/ipython/pull/1150 for details.
375  
-        #elif etype in [QtCore.QEvent.Wheel, QtCore.QEvent.NativeGesture] and \
376  
-
377  
-        elif etype == QtCore.QEvent.Wheel and \
  374
+        # Handle scrolling of the vsplit pager. This hack attempts to solve
  375
+        # problems with tearing of the help text inside the pager window.  This
  376
+        # happens only on Mac OS X with both PySide and PyQt. This fix isn't
  377
+        # perfect but makes the pager more usable.
  378
+        elif etype in self._pager_scroll_events and \
378 379
                 obj == self._page_control:
379 380
             self._page_control.repaint()
380 381
             return True
Commit_comment_tip

Tip: You can add notes to lines in a file. Hover to the left of a line to make a note

Something went wrong with that request. Please try again.