Git Product home page Git Product logo

Comments (1)

schneider42 avatar schneider42 commented on July 30, 2024

As I'm using xmonad as my window manager I got concerned that this is might be an issue with my setup. I tried again with the standard GNOME 3 that comes with Ubuntu 18.04 and 20.04.

On GNOME 3 I was able to reproduce this issue by minimizing the window to the task bar and then restoring it again.

I dug a bit deeper in to the chain of events and this is what's happening:

  • User asks window manager to hide/minimize Inspectrum
  • PlotView::viewportEvent() gets called with QEvent::Type(WindowDeactivate)
  • PlotView::viewportEvent() gets called with QEvent::Type(Leave)
  • PlotView::viewportEvent() gets called with QEvent::Type(Hide)
  • User asks window manager to show/restore Inspectrum
  • PlotView::viewportEvent() gets called with QEvent::Type(Show)
  • PlotView::scrollContentsBy() gets called with dx set to the amount the scroll bar was moved before hiding/minimizing the window.
    • At this point both horizontalScrollBar()->value() and horizontalScrollBar()->maximum() evaluate to 0. It looks like something internal to Qt changed the scrollbar between the calls to PlotView::viewportEvent() and PlotView::scrollContentsBy().
  • PlotView::updateView() gets called by PlotView::scrollContentsBy(). It resets the maximum of the scrollbar back to file length - window size. The original value of the scrollbar is lost though.

After discovering this I had a look at what QGraphicsView (a parent class of PlotView) offers but found nothing which I figured would immediately solve the issue. It looks like QGraphicsView is used a bit outside its original intention as it expects a QGraphicsScene as its content?

I thought that one function might be interesting to get more insight into the issue and I implemented PlotView::showEvent() simply for debugging purposes. Thing is: that solved the issue.

Simply implementing an empty PlotView::showEvent() was enough to fix the issue on xmonad and GNOME 3.

from inspectrum.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.