Ticket #8641: 8641-v4.patch

File 8641-v4.patch, 7.2 KB (added by danielk, 14 years ago)

Here's what's left of the patch, mostly debugging stuff. May be useful in the future.

  • libs/libmythtv/tv_play.h

     
    813813
    814814    // Window info (GUI is optional, transcoding, preview img, etc)
    815815    TvPlayWindow *myWindow;   ///< Our screen, if it exists
    816     ///< player bounds, for after DoEditSchedule() returns to normal playing.
     816    /// player bounds, for after DoEditSchedule() returns to normal playing.
    817817    QRect player_bounds;
    818     ///< Prior GUI window bounds, for DoEditSchedule() and player exit().
     818    /// Prior GUI window bounds, for DoEditSchedule() and player exit().
    819819    QRect saved_gui_bounds;
    820820    /// true if this instance disabled MythUI drawing.
    821821    bool  weDisabledGUI;
  • libs/libmythtv/tv_play.cpp

     
    11541154        }
    11551155
    11561156        MythMainWindow *mainWindow = GetMythMainWindow();
    1157         //QPalette p = mainWindow->palette();
    1158         //p.setColor(mainWindow->backgroundRole(), Qt::black);
    1159         //mainWindow->setPalette(p);
    11601157        mainWindow->installEventFilter(this);
     1158        // get this screen to show on screen immediately..
    11611159        qApp->processEvents();
    11621160    }
    11631161
    11641162    {
     1163        VERBOSE(VB_PLAYBACK, LOC + "Init -- waiting on InitFromDB");
    11651164        QMutexLocker locker(&initFromDBLock);
    11661165        while (!initFromDBDone)
    11671166        {
     
    11701169        }
    11711170    }
    11721171
     1172    VERBOSE(VB_PLAYBACK, LOC + "Init -- starting main loop");
     1173
    11731174    mainLoopCondLock.lock();
    11741175    start();
    11751176    mainLoopCond.wait(&mainLoopCondLock);
     
    11961197    gCoreContext->removeListener(this);
    11971198
    11981199    if (GetMythMainWindow() && weDisabledGUI)
    1199         GetMythMainWindow()->PopDrawDisabled();
     1200        GetMythMainWindow()->PopDrawDisabled(__FILE__, __LINE__);
    12001201
    12011202    if (myWindow)
    12021203    {
     
    19861987        if (GetMythMainWindow() && !weDisabledGUI)
    19871988        {
    19881989            weDisabledGUI = true;
    1989             GetMythMainWindow()->PushDrawDisabled();
     1990            GetMythMainWindow()->PushDrawDisabled(__FILE__, __LINE__);
    19901991            DrawUnusedRects();
    19911992        }
    19921993
     
    20592060            if (GetMythMainWindow() && !weDisabledGUI)
    20602061            {
    20612062                weDisabledGUI = true;
    2062                 GetMythMainWindow()->PushDrawDisabled();
     2063                GetMythMainWindow()->PushDrawDisabled(__FILE__, __LINE__);
    20632064                DrawUnusedRects();
    20642065            }
    20652066
     
    78017802    // else has disabled painting show the MythUI window again.
    78027803    if (GetMythMainWindow() && weDisabledGUI)
    78037804    {
    7804         GetMythMainWindow()->PopDrawDisabled();
     7805        GetMythMainWindow()->PopDrawDisabled(__FILE__, __LINE__);
    78057806        weDisabledGUI = false;
    78067807    }
     7808
    78077809    GetMythMainWindow()->GetPaintWindow()->show();
    78087810}
    78097811
     
    84828484    if (message.left(11) == "EPG_EXITING" ||
    84838485        message.left(18) == "PROGFINDER_EXITING" ||
    84848486        message.left(21) == "VIEWSCHEDULED_EXITING" ||
    8485         message.left(19)   == "PLAYBACKBOX_EXITING" ||
     8487        message.left(19) == "PLAYBACKBOX_EXITING" ||
    84868488        message.left(22) == "SCHEDULEEDITOR_EXITING")
    84878489    {
    84888490        // Resize the window back to the MythTV Player size
     
    85178519        if (!weDisabledGUI)
    85188520        {
    85198521            weDisabledGUI = true;
    8520             GetMythMainWindow()->PushDrawDisabled();
     8522            GetMythMainWindow()->PushDrawDisabled(__FILE__, __LINE__);
    85218523            DrawUnusedRects();
    85228524        }
    85238525
  • libs/libmythtv/videooutbase.cpp

     
    15461546
    15471547void VideoOutput::ExposeEvent(void)
    15481548{
     1549    VERBOSE(VB_IMPORTANT, "VideoOutput::ExposeEvent()");
    15491550    windows[0].SetNeedRepaint(true);
    15501551}
    15511552
  • libs/libmythui/mythmainwindow.cpp

     
    11761176}
    11771177/* FIXME: end compatibility */
    11781178
    1179 uint MythMainWindow::PushDrawDisabled(void)
     1179uint MythMainWindow::PushDrawDisabled(const char *file, int line)
    11801180{
    11811181    QMutexLocker locker(&d->m_drawDisableLock);
     1182    VERBOSE(VB_IMPORTANT, QString("PushDrawDisabled(%1@%2) -- begin")
     1183            .arg(file).arg(line));
    11821184    d->m_drawDisabledDepth++;
    11831185    if (d->m_drawDisabledDepth && d->m_drawEnabled)
    11841186        SetDrawEnabled(false);
     1187    VERBOSE(VB_IMPORTANT, QString("PushDrawDisabled(%1@%2) -- end")
     1188            .arg(file).arg(line));
    11851189    return d->m_drawDisabledDepth;
    11861190}
    11871191
    1188 uint MythMainWindow::PopDrawDisabled(void)
     1192uint MythMainWindow::PopDrawDisabled(const char *file, int line)
    11891193{
    11901194    QMutexLocker locker(&d->m_drawDisableLock);
     1195    VERBOSE(VB_IMPORTANT, QString("PopDrawDisabled(%1@%2) -- begin")
     1196            .arg(file).arg(line));
    11911197    if (d->m_drawDisabledDepth)
    11921198    {
    11931199        d->m_drawDisabledDepth--;
    11941200        if (!d->m_drawDisabledDepth && !d->m_drawEnabled)
    11951201            SetDrawEnabled(true);
    11961202    }
     1203    VERBOSE(VB_IMPORTANT, QString("PopDrawDisabled(%1@%2) -- end")
     1204            .arg(file).arg(line));
    11971205    return d->m_drawDisabledDepth;
    11981206}
    11991207
     
    12031211
    12041212    if (!gCoreContext->IsUIThread())
    12051213    {
     1214        VERBOSE(VB_IMPORTANT, LOC + QString("SetDrawEnabled(%1) -- outside UI")
     1215                .arg(enable));
     1216
    12061217        QCoreApplication::postEvent(
    12071218            this, new MythEvent(
    12081219                (enable) ?
    12091220                MythEvent::kEnableDrawingEventType :
    12101221                MythEvent::kDisableDrawingEventType));
    12111222
     1223        VERBOSE(VB_IMPORTANT, LOC + QString("SetDrawEnabled(%1) -- waiting")
     1224                .arg(enable));
     1225
    12121226        while (QCoreApplication::hasPendingEvents())
    12131227            d->m_setDrawEnabledWait.wait(&d->m_setDrawEnabledLock);
    12141228
     1229        VERBOSE(VB_IMPORTANT, LOC + QString("SetDrawEnabled(%1) -- done")
     1230                .arg(enable));
     1231
    12151232        return;
    12161233    }
    12171234
     1235    static uint ecnt = 0, dcnt = 0;
     1236    ecnt += enable ? 1 : 0;
     1237    dcnt += enable ? 0 : 1;
     1238
     1239    VERBOSE(VB_IMPORTANT, LOC + QString("SetDrawEnabled(%1) cnt %2")
     1240            .arg(enable).arg(enable?ecnt:dcnt));
     1241
    12181242    setUpdatesEnabled(enable);
    12191243    d->m_drawEnabled = enable;
    12201244
     
    20292053    }
    20302054    else if (ce->type() == MythEvent::kPushDisableDrawingEventType)
    20312055    {
    2032         PushDrawDisabled();
     2056        PushDrawDisabled(__FILE__, __LINE__);
    20332057    }
    20342058    else if (ce->type() == MythEvent::kPopDisableDrawingEventType)
    20352059    {
    2036         PopDrawDisabled();
     2060        PopDrawDisabled(__FILE__, __LINE__);
    20372061    }
    20382062    else if (ce->type() == MythEvent::kDisableDrawingEventType)
    20392063    {
  • libs/libmythui/mythmainwindow.h

     
    113113
    114114    QWidget *currentWidget(void);
    115115
    116     uint PushDrawDisabled(void);
    117     uint PopDrawDisabled(void);
     116    uint PushDrawDisabled(const char *file, int line);
     117    uint PopDrawDisabled(const char *file, int line);
    118118    void SetEffectsEnabled(bool enable);
    119119
    120120  public slots: