VirtualBox

Changeset 77414 in vbox


Ignore:
Timestamp:
Feb 21, 2019 6:36:49 PM (6 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
128975
Message:

VBoxDbg: some code cleanup

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Debugger/VBoxDbgBase.cpp

    r77412 r77414  
    266266{
    267267#ifdef Q_WS_X11 /* (from the qt gui) */
    268     /* only once. */
    269     if (!m_cxBorder && !m_cyBorder)
    270     {
    271 
    272         /* On X11, there is no way to determine frame geometry (including WM
    273          * decorations) before the widget is shown for the first time. Stupidly
    274          * enumerate other top level widgets to find the thickest frame. The code
    275          * is based on the idea taken from QDialog::adjustPositionInternal(). */
    276 
    277         int extraw = 0, extrah = 0;
    278 
    279         QWidgetList list = QApplication::topLevelWidgets();
    280         QListIterator<QWidget*> it (list);
    281         while ((extraw == 0 || extrah == 0) && it.hasNext())
     268    /*
     269     * On X11, there is no way to determine frame geometry (including WM
     270     * decorations) before the widget is shown for the first time.  Stupidly
     271     * enumerate other top level widgets to find the thickest frame.
     272     */
     273    if (!m_cxBorder && !m_cyBorder) /* (only till we're successful) */
     274    {
     275        int cxExtra = 0;
     276        int cyExtra = 0;
     277
     278        QWidgetList WidgetList = QApplication::topLevelWidgets();
     279        for (QListIterator<QWidget *> it(WidgetList); it.hasNext(); )
    282280        {
    283             int framew, frameh;
    284             QWidget *current = it.next();
    285             if (!current->isVisible())
    286                 continue;
    287 
    288             framew = current->frameGeometry().width() - current->width();
    289             frameh = current->frameGeometry().height() - current->height();
    290 
    291             extraw = qMax (extraw, framew);
    292             extrah = qMax (extrah, frameh);
     281            QWidget *pCurWidget = it.next();
     282            if (pCurWidget->isVisible())
     283            {
     284                int const cxFrame = pCurWidget->frameGeometry().width()  - pCurWidget->width();
     285                cxExtra = qMax(cxExtra, cxFrame);
     286                int const cyFrame = pCurWidget->frameGeometry().height() - pCurWidget->height();
     287                cyExtra = qMax(cyExtra, cyFrame);
     288                if (cyExtra && cxExtra)
     289                    break;
     290            }
    293291        }
    294292
    295         if (extraw || extrah)
     293        if (cxExtra || cyExtra)
    296294        {
    297             m_cxBorder = extraw;
    298             m_cyBorder = extrah;
     295            m_cxBorder = cxExtra;
     296            m_cyBorder = cyExtra;
    299297        }
    300298    }
Note: See TracChangeset for help on using the changeset viewer.

© 2025 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette