Make sure splash screen gets focus. Also better key press/release handling in working banner.
This commit is contained in:
parent
72f2ef3617
commit
4635d9bf76
@ -35,7 +35,7 @@
|
||||
#define VER_LAMEXP_MINOR_LO 9
|
||||
#define VER_LAMEXP_TYPE Alpha
|
||||
#define VER_LAMEXP_PATCH 9
|
||||
#define VER_LAMEXP_BUILD 1490
|
||||
#define VER_LAMEXP_BUILD 1495
|
||||
#define VER_LAMEXP_CONFG 1348
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
|
@ -126,7 +126,7 @@ void SplashScreen::showSplash(QThread *thread)
|
||||
|
||||
//Wait for window to show
|
||||
QApplication::processEvents(QEventLoop::ExcludeUserInputEvents);
|
||||
splashScreen->repaint();
|
||||
splashScreen->repaint(); lamexp_bring_to_front(splashScreen);
|
||||
QApplication::processEvents(QEventLoop::ExcludeUserInputEvents);
|
||||
|
||||
//Connect thread signals
|
||||
@ -181,6 +181,7 @@ void SplashScreen::updateHandler(void)
|
||||
else
|
||||
{
|
||||
setWindowOpacity(1.0);
|
||||
lamexp_bring_to_front(this);
|
||||
m_timer->stop();
|
||||
m_status = STATUS_WAIT;
|
||||
}
|
||||
@ -209,6 +210,7 @@ void SplashScreen::threadComplete(void)
|
||||
{
|
||||
m_timer->start(FADE_DELAY);
|
||||
}
|
||||
lamexp_bring_to_front(this);
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
|
@ -236,12 +236,12 @@ void WorkingBanner::keyPressEvent(QKeyEvent *event)
|
||||
QTimer::singleShot(0, parent(), SLOT(showMinimized()));
|
||||
}
|
||||
|
||||
event->ignore();
|
||||
QDialog::keyPressEvent(event);
|
||||
}
|
||||
|
||||
void WorkingBanner::keyReleaseEvent(QKeyEvent *event)
|
||||
{
|
||||
event->ignore();
|
||||
QDialog::keyReleaseEvent(event);
|
||||
}
|
||||
|
||||
void WorkingBanner::closeEvent(QCloseEvent *event)
|
||||
|
@ -149,6 +149,7 @@ const QStringList &lamexp_arguments(void);
|
||||
QStringList lamexp_available_codepages(bool noAliases = true);
|
||||
bool lamexp_beep(int beepType);
|
||||
void lamexp_blink_window(QWidget *poWindow, unsigned int count = 10, unsigned int delay = 150);
|
||||
bool lamexp_block_window_move(void *message);
|
||||
bool lamexp_bring_process_to_front(const unsigned long pid);
|
||||
bool lamexp_bring_to_front(const QWidget *win);
|
||||
bool lamexp_broadcast(int eventType, bool onlyToVisible);
|
||||
|
@ -1495,6 +1495,26 @@ int lamexp_system_message(const wchar_t *text, int beepType)
|
||||
return MessageBoxW(NULL, text, L"LameXP", flags);
|
||||
}
|
||||
|
||||
/*
|
||||
* Block window "move" message
|
||||
*/
|
||||
bool lamexp_block_window_move(void *message)
|
||||
{
|
||||
if(message)
|
||||
{
|
||||
MSG *msg = reinterpret_cast<MSG*>(message);
|
||||
if((msg->message == WM_SYSCOMMAND) && (msg->wParam == SC_MOVE))
|
||||
{
|
||||
return true;
|
||||
}
|
||||
if((msg->message == WM_NCLBUTTONDOWN) && (msg->wParam == HTCAPTION))
|
||||
{
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
/*
|
||||
* Suspend calling thread for N milliseconds
|
||||
*/
|
||||
@ -1745,8 +1765,12 @@ bool lamexp_bring_to_front(const QWidget *window)
|
||||
|
||||
if(window)
|
||||
{
|
||||
ret = (SetForegroundWindow(window->winId()) == TRUE);
|
||||
SwitchToThisWindow(window->winId(), TRUE);
|
||||
for(int i = 0; (i < 5) && (!ret); i++)
|
||||
{
|
||||
ret = (SetForegroundWindow(window->winId()) != FALSE);
|
||||
SwitchToThisWindow(window->winId(), TRUE);
|
||||
}
|
||||
LockSetForegroundWindow(LSFW_LOCK);
|
||||
}
|
||||
|
||||
return ret;
|
||||
|
Loading…
Reference in New Issue
Block a user