* Removed the 150ms delay before showing the window - the window is now always
opened only once the stream is ready. This fixes the random "open in audio position" of video files. * Removed a call to _ShowIfNeeded() in _RefsReceived(); it doesn't seem to have any purpose. * Center new video windows on screen. * Call _ShowIfNeeded() after the window has been positioned and resized in _SetupWindow(). This fixes having the window jump around on screen after launch. git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@42352 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
@@ -112,8 +112,6 @@ enum {
|
|||||||
|
|
||||||
M_FILE_DELETE,
|
M_FILE_DELETE,
|
||||||
|
|
||||||
M_SHOW_IF_NEEDED,
|
|
||||||
|
|
||||||
M_SLIDE_CONTROLS,
|
M_SLIDE_CONTROLS,
|
||||||
M_FINISH_SLIDING_CONTROLS
|
M_FINISH_SLIDING_CONTROLS
|
||||||
};
|
};
|
||||||
@@ -169,13 +167,10 @@ static const char* kDisabledSeekMessage = B_TRANSLATE("Drop files to play");
|
|||||||
static const char* kApplicationName = B_TRANSLATE_SYSTEM_NAME(NAME);
|
static const char* kApplicationName = B_TRANSLATE_SYSTEM_NAME(NAME);
|
||||||
|
|
||||||
|
|
||||||
//#define printf(a...)
|
|
||||||
|
|
||||||
|
|
||||||
MainWin::MainWin(bool isFirstWindow, BMessage* message)
|
MainWin::MainWin(bool isFirstWindow, BMessage* message)
|
||||||
:
|
:
|
||||||
BWindow(BRect(100, 100, 400, 300), kApplicationName, B_TITLED_WINDOW,
|
BWindow(BRect(100, 100, 400, 300), kApplicationName, B_TITLED_WINDOW,
|
||||||
B_ASYNCHRONOUS_CONTROLS /* | B_WILL_ACCEPT_FIRST_CLICK */),
|
B_ASYNCHRONOUS_CONTROLS),
|
||||||
fCreationTime(system_time()),
|
fCreationTime(system_time()),
|
||||||
fInfoWin(NULL),
|
fInfoWin(NULL),
|
||||||
fPlaylistWindow(NULL),
|
fPlaylistWindow(NULL),
|
||||||
@@ -939,10 +934,6 @@ MainWin::MessageReceived(BMessage* msg)
|
|||||||
_AdoptGlobalSettings();
|
_AdoptGlobalSettings();
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case M_SHOW_IF_NEEDED:
|
|
||||||
_ShowIfNeeded();
|
|
||||||
break;
|
|
||||||
|
|
||||||
case M_SLIDE_CONTROLS:
|
case M_SLIDE_CONTROLS:
|
||||||
{
|
{
|
||||||
float offset;
|
float offset;
|
||||||
@@ -1094,12 +1085,6 @@ MainWin::OpenPlaylistItem(const PlaylistItemRef& item)
|
|||||||
BString string;
|
BString string;
|
||||||
string << "Opening '" << item->Name() << "'.";
|
string << "Opening '" << item->Name() << "'.";
|
||||||
fControls->SetDisabledString(string.String());
|
fControls->SetDisabledString(string.String());
|
||||||
|
|
||||||
if (IsHidden()) {
|
|
||||||
BMessage showMessage(M_SHOW_IF_NEEDED);
|
|
||||||
BMessageRunner::StartSending(BMessenger(this), &showMessage,
|
|
||||||
150000, 1);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1304,7 +1289,6 @@ MainWin::_RefsReceived(BMessage* message)
|
|||||||
|
|
||||||
if (message->FindRect("window frame", &fNoVideoFrame) != B_OK)
|
if (message->FindRect("window frame", &fNoVideoFrame) != B_OK)
|
||||||
fNoVideoFrame = BRect();
|
fNoVideoFrame = BRect();
|
||||||
_ShowIfNeeded();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -1396,8 +1380,6 @@ MainWin::_SetupWindow()
|
|||||||
}
|
}
|
||||||
_UpdateControlsEnabledStatus();
|
_UpdateControlsEnabledStatus();
|
||||||
|
|
||||||
_ShowIfNeeded();
|
|
||||||
|
|
||||||
// Adopt the size and window layout if necessary
|
// Adopt the size and window layout if necessary
|
||||||
if (previousSourceWidth != fSourceWidth
|
if (previousSourceWidth != fSourceWidth
|
||||||
|| previousSourceHeight != fSourceHeight
|
|| previousSourceHeight != fSourceHeight
|
||||||
@@ -1415,6 +1397,8 @@ MainWin::_SetupWindow()
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
_ShowIfNeeded();
|
||||||
|
|
||||||
fVideoView->MakeFocus();
|
fVideoView->MakeFocus();
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -2320,13 +2304,16 @@ MainWin::_ToggleNoInterface()
|
|||||||
void
|
void
|
||||||
MainWin::_ShowIfNeeded()
|
MainWin::_ShowIfNeeded()
|
||||||
{
|
{
|
||||||
|
// Only proceed if the window is already running
|
||||||
if (find_thread(NULL) != Thread())
|
if (find_thread(NULL) != Thread())
|
||||||
return;
|
return;
|
||||||
|
|
||||||
if (!fHasVideo && fNoVideoFrame.IsValid()) {
|
if (!fHasVideo && fNoVideoFrame.IsValid()) {
|
||||||
MoveTo(fNoVideoFrame.LeftTop());
|
MoveTo(fNoVideoFrame.LeftTop());
|
||||||
ResizeTo(fNoVideoFrame.Width(), fNoVideoFrame.Height());
|
ResizeTo(fNoVideoFrame.Width(), fNoVideoFrame.Height());
|
||||||
}
|
} else if (fHasVideo && IsHidden())
|
||||||
|
CenterOnScreen();
|
||||||
|
|
||||||
fNoVideoFrame = BRect();
|
fNoVideoFrame = BRect();
|
||||||
|
|
||||||
if (IsHidden()) {
|
if (IsHidden()) {
|
||||||
|
|||||||
Reference in New Issue
Block a user