[Konsole-devel] [frameworks-kwindowsystem] [Bug 349512] Konsole and other KDE Apps Crash during KWindowSystemPrivateX11::viewportToDesktop

matt at eisgr.com matt at eisgr.com
Fri Sep 4 13:03:14 UTC 2015


https://bugs.kde.org/show_bug.cgi?id=349512

--- Comment #5 from matt at eisgr.com ---
Assuming "apt-get source kwindowsystem" gave me the right source, the crash is
happening here:

int KWindowSystemPrivateX11::viewportToDesktop(const QPoint &p)
{
    init(INFO_BASIC);
    NETEventFilter *const s_d = s_d_func();
    NETSize s = s_d->desktopGeometry();
    QSize vs = qApp->desktop()->size();
/////  RIGHT HERE
    int xs = s.width / vs.width();
///////  ^^^^^^^^
    int x = p.x() < 0 ? 0 : p.x() >= s.width ? xs - 1 : p.x() / vs.width();
    int ys = s.height / vs.height();
    int y = p.y() < 0 ? 0 : p.y() >= s.height ? ys - 1 : p.y() / vs.height();
    return y * xs + x + 1;
}


If by chance this is being called while vs.width() returns 0 (which seems a
possibility while the system is resuming from sleep or renegotiating Desktop
size with multiple monitors), this would cause a  Floating point exception as
indicated by DrKonqi.

Help please?  I'm new to the codebase.  When would vs.width() return 0? 
Perhaps while an object (possibly qApp-desktop() ? ) is being initialized/setup
with real values?  Perhaps in an exception mode where 0 is returned?

-- 
You are receiving this mail because:
You are the assignee for the bug.


More information about the konsole-devel mailing list