Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP

Loading…

Pager tearing bug #1153

Merged
merged 1 commit into from

2 participants

@prabhuramachandran

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.

@fperez
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.

@prabhuramachandran prabhuramachandran 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
@prabhuramachandran

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

@fperez
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!

@fperez fperez merged commit 811b745 into ipython:master
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Commits on Dec 14, 2011
  1. @prabhuramachandran

    BUG: Scrolling pager in vsplit on Mac OSX tears.

    prabhuramachandran authored
    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.
This page is out of date. Refresh to see the latest.
Showing with 12 additions and 11 deletions.
  1. +12 −11 IPython/frontend/qt/console/console_widget.py
View
23 IPython/frontend/qt/console/console_widget.py
@@ -172,6 +172,13 @@ def __init__(self, parent=None, **kw):
QtGui.QWidget.__init__(self, parent)
LoggingConfigurable.__init__(self, **kw)
+ # While scrolling the pager on Mac OS X, it tears badly. The
+ # NativeGesture is platform and perhaps build-specific hence
+ # we take adequate precautions here.
+ self._pager_scroll_events = [QtCore.QEvent.Wheel]
+ if hasattr(QtCore.QEvent, 'NativeGesture'):
+ self._pager_scroll_events.append(QtCore.QEvent.NativeGesture)
+
# Create the layout and underlying text widget.
layout = QtGui.QStackedLayout(self)
layout.setContentsMargins(0, 0, 0, 0)
@@ -364,17 +371,11 @@ def eventFilter(self, obj, event):
QtGui.qApp.sendEvent(obj, QtGui.QDragLeaveEvent())
return True
- # Handle scrolling of the vsplit pager. This hack attempts to solve the
- # problem of tearing of the pager window's help text on Mac OS X. This
- # happens with PySide and PyQt. This fix isn't perfect but makes the
- # pager more usable.
-
- # FIXME: this line, on qt 4.8.5, crashes b/c NativeGesture is not
- # available. Disabling for now, until we sort out a cleaner solution.
- # See https://github.com/ipython/ipython/pull/1150 for details.
- #elif etype in [QtCore.QEvent.Wheel, QtCore.QEvent.NativeGesture] and \
-
- elif etype == QtCore.QEvent.Wheel and \
+ # Handle scrolling of the vsplit pager. This hack attempts to solve
+ # problems with tearing of the help text inside the pager window. This
+ # happens only on Mac OS X with both PySide and PyQt. This fix isn't
+ # perfect but makes the pager more usable.
+ elif etype in self._pager_scroll_events and \
obj == self._page_control:
self._page_control.repaint()
return True
Something went wrong with that request. Please try again.