Ticket #6790: tvwin_fixes.diff

File tvwin_fixes.diff, 5.8 KB (added by stuartm, 16 years ago)

Possible fix

  • mythtv/libs/libmythtv/tv_play.cpp

     
    897897        // player window sizing
    898898        MythScreenStack *mainStack = GetMythMainWindow()->GetMainStack();
    899899
    900         myWindow = new TvPlayWindow(mainStack, "Playback");
     900        myWindow = new TvPlayWindow(mainStack);
    901901
    902902        if (myWindow->Create())
    903903            mainStack->AddScreen(myWindow, false);
     
    908908        }
    909909
    910910        MythMainWindow *mainWindow = GetMythMainWindow();
    911         //QPalette p = mainWindow->palette();
    912         //p.setColor(mainWindow->backgroundRole(), Qt::black);
    913         //mainWindow->setPalette(p);
    914911        mainWindow->installEventFilter(this);
    915912        qApp->processEvents();
    916913    }
     
    987984    }
    988985    ReturnPlayerLock(mctx);
    989986
    990     GetMythMainWindow()->GetPaintWindow()->show();
     987    //GetMythMainWindow()->SetDrawEnabled(true);
    991988
    992989    VERBOSE(VB_PLAYBACK, "TV::~TV() -- end");
    993990}
     
    20021999            (db_use_fixed_size) ? player_bounds.size() :
    20032000            QSize(QWIDGETSIZE_MAX, QWIDGETSIZE_MAX));
    20042001        mainWindow->setGeometry(player_bounds);
    2005 
    2006         // hide the GUI paint window
    2007         GetMythMainWindow()->GetPaintWindow()->hide();
    20082002    }
    20092003
    20102004    VERBOSE(VB_PLAYBACK, LOC +
     
    48714865    if (StateIsLiveTV(mctx->GetState()))
    48724866        mctx->buffer->Unpause();
    48734867
    4874     bool ok = mctx->CreateNVP(
    4875         this, gContext->GetMainWindow(), mctx->GetState(), 0, &mctx->embedBounds);
     4868    QWidget *widget = gContext->GetMainWindow()->GetPaintWindow();
    48764869
     4870    bool ok = mctx->CreateNVP(this, widget, mctx->GetState(), 0,
     4871                              &mctx->embedBounds);
     4872
    48774873    if (ok)
    48784874    {
    48794875        ScheduleStateChange(mctx);
     
    49954991    }
    49964992    else
    49974993    {
    4998         ok = ctx->CreateNVP(this, gContext->GetMainWindow(), desiredState,
     4994        QWidget *widget = gContext->GetMainWindow()->GetPaintWindow();
     4995       
     4996        ok = ctx->CreateNVP(this, widget, desiredState,
    49994997                            mctx->embedWinID, &mctx->embedBounds);
    50004998        ScheduleStateChange(ctx);
    50014999    }
     
    53825380    mctx->SetPIPState(kPIPOff);
    53835381    mctx->buffer->Seek(0, SEEK_SET);
    53845382
    5385     if (mctx->CreateNVP(this, gContext->GetMainWindow(), mctx->GetState(),
     5383    QWidget *widget = gContext->GetMainWindow()->GetPaintWindow();
     5384   
     5385    if (mctx->CreateNVP(this, widget, mctx->GetState(),
    53865386                        mctx->embedWinID, &mctx->embedBounds))
    53875387    {
    53885388        ScheduleStateChange(mctx);
     
    79237923    }
    79247924    else
    79257925    {
    7926         //we are embedding in a mythui window so show the gui paint window again
    7927         GetMythMainWindow()->GetPaintWindow()->show();
     7926        //we are embedding in a mythui window so re-enable drawing
     7927        //GetMythMainWindow()->SetDrawEnabled(true);
    79287928    }
    79297929}
    79307930
     
    79357935    // this will create the program guide window (widget)
    79367936    // on the main thread and avoid a deadlock on Win32
    79377937    QString message = QString("START_EPG %1").arg(editType);
     7938    //GetMythMainWindow()->SetDrawEnabled(true);
    79387939    MythEvent* me = new MythEvent(message);
    79397940    qApp->postEvent(gContext->GetMainWindow(), me);
    79407941}
     
    86148615        PlayerContext *mctx;
    86158616        MythMainWindow *mwnd = gContext->GetMainWindow();
    86168617
     8618        GetMythMainWindow()->GetPaintWindow()->clearMask();
     8619        //GetMythMainWindow()->SetDrawEnabled(false);
     8620       
    86178621        StopEmbedding(actx);                // Undo any embedding
    86188622        SetPlayerVisibility(actx, kVisibility_Normal);
    8619 
     8623       
    86208624        mctx = GetPlayerReadLock(0, __FILE__, __LINE__);
    86218625        mctx->LockDeleteNVP(__FILE__, __LINE__);
    86228626        if (mctx->nvp && mctx->nvp->getVideoOutput())
     
    86348638
    86358639        DoSetPauseState(actx, saved_pause); // Restore pause states
    86368640
    8637         GetMythMainWindow()->GetPaintWindow()->hide();
    8638         GetMythMainWindow()->GetPaintWindow()->clearMask();
    8639 
    86408641        qApp->processEvents();
    86418642        DrawUnusedRects(true, actx);
    86428643
  • mythtv/libs/libmythtv/NuppelVideoPlayer.cpp

     
    720720        {
    721721            MythMainWindow *window = gContext->GetMainWindow();
    722722
    723             QWidget *widget =
    724                 window->findChild<QWidget*>("video playback window");
     723            QWidget *widget = window->GetPaintWindow();
    725724
    726725            if (!widget)
    727726            {
     
    738737            return false;
    739738        }
    740739
     740        // Suspend GUI painting
     741        //GetMythMainWindow()->SetDrawEnabled(false);
     742
    741743        QRect display_rect;
    742744        int pbp_width = widget->width() / 2;
    743745        if (pipState == kPIPStandAlone)
  • mythtv/libs/libmythtv/tv_play_win.cpp

     
    99#include "tv_play_win.h"
    1010
    1111
    12 TvPlayWindow::TvPlayWindow(MythScreenStack *parent, const char *name)
    13             : MythScreenType(parent, name)
     12TvPlayWindow::TvPlayWindow(MythScreenStack *parent)
     13             : MythScreenType(parent, "video playback window")
    1414{
    1515    SetCanTakeFocus(true);
    1616}
  • mythtv/libs/libmythtv/tv_play_win.h

     
    1212    Q_OBJECT
    1313
    1414  public:
    15     TvPlayWindow(MythScreenStack *parent, const char *name);
     15    TvPlayWindow(MythScreenStack *parent);
    1616   ~TvPlayWindow();
    1717
    1818    virtual void gestureEvent(MythUIType *, MythGestureEvent *);