Ticket #578: osxWindowHide.patch

File osxWindowHide.patch, 2.1 KB (added by gkruse@…, 18 years ago)

patch to hide main window on playback

  • libs/libmythtv/videoout_quartz.cpp

     
    5252#import <CoreGraphics/CGBase.h>
    5353#import <CoreGraphics/CGDisplayConfiguration.h>
    5454#import <CoreGraphics/CGImage.h>
    55 #import <Carbon/Carbon.h>
    5655#import <QuickTime/QuickTime.h>
    5756
    5857class VideoOutputQuartzView;
     
    13911390            tmp->SetFrameSkip(gContext->GetNumSetting("MacMainSkip", 0));
    13921391            data->views.append(tmp);
    13931392        }
     1393        else { 
     1394            //if video in the main window is not enabled, hide it so it is not in the way
     1395            Rect theBounds;
     1396            GetWindowBounds (data->window, kWindowStructureRgn, &theBounds);
     1397            defaultWindowBounds = theBounds;
     1398            SizeWindow(data->window, 1, 1, true);
     1399            //todo -- it would be nice if we could see the mouse when in windowed mode
     1400        }
    13941401        if (gContext->GetNumSetting("MacFloatEnabled", 0))
    13951402        {
    13961403            float opacity =
     
    15311538    if (Started)
    15321539    {
    15331540        Started = false;
     1541               
     1542        //unhide main window
     1543        //we don't care about this if we are in full screen mode
     1544        if (data->windowedMode){
     1545            VERBOSE(VB_PLAYBACK,
     1546                QString("Restoring Main Window to %1x%2")
     1547                    .arg(defaultWindowBounds.right - defaultWindowBounds.left).arg(defaultWindowBounds.bottom - defaultWindowBounds.top));
    15341548
     1549            SetWindowBounds (data->window, kWindowStructureRgn, &defaultWindowBounds);
     1550        }
    15351551        data->views.clear();
    15361552        DeleteQuartzBuffers();
    15371553    }
  • libs/libmythtv/videoout_quartz.h

     
    44struct QuartzData;
    55
    66#include "videooutbase.h"
     7#import <Carbon/Carbon.h>
    78
    89class VideoOutputQuartz : public VideoOutput
    910{
     
    4243    QuartzData * data;
    4344
    4445    VideoFrame   pauseFrame;
     46       
     47    Rect defaultWindowBounds;   
    4548};
    4649
    4750#endif