mirror of
https://github.com/rizinorg/cutter.git
synced 2025-01-29 15:55:04 +00:00
Fix VisualNavbar Crash on Haiku
This commit is contained in:
parent
c07ce55581
commit
bd4342c4cb
@ -25,6 +25,8 @@ VisualNavbar::VisualNavbar(MainWindow *main, QWidget *parent)
|
||||
{
|
||||
Q_UNUSED(parent);
|
||||
|
||||
blockTooltip = false;
|
||||
|
||||
setObjectName("visualNavbar");
|
||||
setWindowTitle(tr("Visual navigation bar"));
|
||||
// setMovable(false);
|
||||
@ -240,11 +242,17 @@ void VisualNavbar::on_seekChanged(RVA addr)
|
||||
|
||||
void VisualNavbar::mousePressEvent(QMouseEvent *event)
|
||||
{
|
||||
if (blockTooltip) {
|
||||
return;
|
||||
}
|
||||
qreal x = qhelpers::mouseEventPos(event).x();
|
||||
RVA address = localXToAddress(x);
|
||||
if (address != RVA_INVALID) {
|
||||
auto tooltipPos = qhelpers::mouseEventGlobalPos(event);
|
||||
blockTooltip = true; // on Haiku, the below call sometimes triggers another mouseMoveEvent,
|
||||
// causing infinite recursion
|
||||
QToolTip::showText(tooltipPos, toolTipForAddress(address), this, this->rect());
|
||||
blockTooltip = false;
|
||||
if (event->buttons() & Qt::LeftButton) {
|
||||
event->accept();
|
||||
Core()->seek(address);
|
||||
|
@ -48,6 +48,7 @@ private:
|
||||
unsigned int previousWidth = 0;
|
||||
|
||||
QList<XToAddress> xToAddress;
|
||||
bool blockTooltip;
|
||||
|
||||
RVA localXToAddress(double x);
|
||||
double addressToLocalX(RVA address);
|
||||
|
Loading…
Reference in New Issue
Block a user