diff --git a/aegisub/dialog_detached_video.cpp b/aegisub/dialog_detached_video.cpp index 7e748fd1c..1e686502b 100644 --- a/aegisub/dialog_detached_video.cpp +++ b/aegisub/dialog_detached_video.cpp @@ -54,6 +54,9 @@ DialogDetachedVideo::DialogDetachedVideo(FrameMain *par) // Set parent parent = par; + // Set obscure stuff + SetExtraStyle(GetExtraStyle() & (~wxWS_EX_BLOCK_EVENTS) | wxWS_EX_PROCESS_UI_UPDATES); + // Set title wxFileName fn(VideoContext::Get()->videoName); SetTitle(wxString::Format(_("Video: %s"),fn.GetFullName().c_str())); diff --git a/aegisub/video_box.cpp b/aegisub/video_box.cpp index 934dbcfbd..584e2234d 100644 --- a/aegisub/video_box.cpp +++ b/aegisub/video_box.cpp @@ -63,11 +63,10 @@ /////////////// // Constructor VideoBox::VideoBox(wxWindow *parent) -: wxPanel (parent,5000) +: wxPanel (parent,-1) { // Parent videoPage = this; - frame = AegisubApp::Get()->frame; // Visual controls sub-toolbar visualSubToolBar = new wxToolBar(videoPage,-1,wxDefaultPosition,wxDefaultSize,wxTB_HORIZONTAL | wxTB_BOTTOM | wxTB_FLAT); @@ -96,7 +95,7 @@ VideoBox::VideoBox(wxWindow *parent) VideoSubsPos->SetToolTip(_("Time of this frame relative to start and end of current subs.")); // Display - videoDisplay = new VideoDisplay(videoPage,-1,wxDefaultPosition,wxDefaultSize,wxSUNKEN_BORDER,_T("VideoBox")); + videoDisplay = new VideoDisplay(videoPage,-1,wxDefaultPosition,wxDefaultSize,wxSUNKEN_BORDER); videoDisplay->ControlSlider = videoSlider; videoDisplay->PositionDisplay = VideoPosition; videoDisplay->SubsPosition = VideoSubsPos; diff --git a/aegisub/video_box.h b/aegisub/video_box.h index 3c0cfea85..3a274a87a 100644 --- a/aegisub/video_box.h +++ b/aegisub/video_box.h @@ -81,7 +81,6 @@ public: wxTextCtrl *VideoSubsPos; VideoDisplay *videoDisplay; VideoSlider *videoSlider; - FrameMain *frame; VideoBox (wxWindow *parent); diff --git a/aegisub/video_display.cpp b/aegisub/video_display.cpp index 9adedf55d..401686a27 100644 --- a/aegisub/video_display.cpp +++ b/aegisub/video_display.cpp @@ -235,6 +235,7 @@ void VideoDisplay::Render() { glMatrixMode(GL_MODELVIEW); glLoadIdentity(); glViewport(dx1,dy1,dx2,dy2); + if (glGetError()) throw _T("Error setting GL viewport."); glMatrixMode(GL_PROJECTION); glLoadIdentity(); glOrtho(0.0f,sw,sh,0.0f,-1000.0f,1000.0f); @@ -372,8 +373,8 @@ void VideoDisplay::DrawOverscanMask(int sizeH,int sizeV,wxColour colour,double a /////////////// // Update size void VideoDisplay::UpdateSize() { - // Free size? - if (freeSize) return; + // Don't do anything if it's a free sizing display + //if (freeSize) return; // Loaded? VideoContext *con = VideoContext::Get(); @@ -382,9 +383,14 @@ void VideoDisplay::UpdateSize() { if (!IsShownOnScreen()) return; // Get size - if (con->GetAspectRatioType() == 0) w = int(con->GetWidth() * zoomValue); - else w = int(con->GetHeight() * zoomValue * con->GetAspectRatioValue()); - h = int(con->GetHeight() * zoomValue); + if (freeSize) { + GetClientSize(&w,&h); + } + else { + if (con->GetAspectRatioType() == 0) w = int(con->GetWidth() * zoomValue); + else w = int(con->GetHeight() * zoomValue * con->GetAspectRatioValue()); + h = int(con->GetHeight() * zoomValue); + } int _w,_h; if (w <= 1 || h <= 1) return; locked = true; @@ -438,6 +444,9 @@ void VideoDisplay::OnPaint(wxPaintEvent& event) { // Size Event void VideoDisplay::OnSizeEvent(wxSizeEvent &event) { //Refresh(false); + if (freeSize) { + UpdateSize(); + } event.Skip(); }