Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[browser] Do not raise overlay when starting with requested url. Fixes JB#56791 #996

Merged
merged 1 commit into from Apr 14, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 1 addition & 1 deletion apps/browser/qml/pages/BrowserPage.qml
Expand Up @@ -308,7 +308,7 @@ Page {
onActiveChanged: {
var isFullScreen = webView.contentItem && webView.contentItem.fullscreen
if (!isFullScreen && active && !overlay.enteringNewTabUrl) {
if (webView.tabModel.count !== 0 || (WebUtils.homePage !== "about:blank" && WebUtils.homePage.length > 0)) {
if (webView.hasInitialUrl || webView.tabModel.count !== 0 || (WebUtils.homePage !== "about:blank" && WebUtils.homePage.length > 0)) {
overlay.animator.showChrome()
} else {
overlay.startPage()
Expand Down
16 changes: 16 additions & 0 deletions apps/core/declarativewebcontainer.cpp
Expand Up @@ -681,7 +681,12 @@ bool DeclarativeWebContainer::eventFilter(QObject *obj, QEvent *event)
m_closeEventFilter->applicationClosingStarted();
if (!m_closing) {
m_webPages->clear();
bool initialUrl = hasInitialUrl();
m_initialUrl = "";
if (initialUrl) {
emit hasInitialUrlChanged();
}

m_initialized = false;
destroyWindow();
if (QMozContext::instance()->getNumberOfWindows() != 0) {
Expand Down Expand Up @@ -994,6 +999,12 @@ void DeclarativeWebContainer::initialize()
m_completed = true;
emit completedChanged();
}

bool initialUrl = hasInitialUrl();
m_initialUrl = "";
if (initialUrl) {
emit hasInitialUrlChanged();
}
}

void DeclarativeWebContainer::onDownloadStarted()
Expand Down Expand Up @@ -1180,6 +1191,11 @@ void DeclarativeWebContainer::setHistoryModel(DeclarativeHistoryModel *model)
}
}

bool DeclarativeWebContainer::hasInitialUrl() const
{
return !m_initialUrl.isEmpty();
}

void DeclarativeWebContainer::dsmeStateChange(const QString &state)
{
if ((state == "REBOOT" || state == "SHUTDOWN") && m_closeEventFilter)
Expand Down
6 changes: 6 additions & 0 deletions apps/core/declarativewebcontainer.h
Expand Up @@ -80,6 +80,8 @@ class DeclarativeWebContainer : public QWindow, public QQmlParserStatus, protect
Q_PROPERTY(QMozSecurity *security READ security NOTIFY securityChanged)
Q_PROPERTY(DeclarativeHistoryModel* historyModel READ historyModel WRITE setHistoryModel NOTIFY historyModelChanged)

Q_PROPERTY(bool hasInitialUrl READ hasInitialUrl NOTIFY hasInitialUrlChanged)

public:
DeclarativeWebContainer(QWindow *parent = 0);
~DeclarativeWebContainer();
Expand Down Expand Up @@ -164,6 +166,8 @@ class DeclarativeWebContainer : public QWindow, public QQmlParserStatus, protect
DeclarativeHistoryModel *historyModel() const;
void setHistoryModel(DeclarativeHistoryModel *model);

bool hasInitialUrl() const;

signals:
void rotationHandlerChanged();
void contentItemChanged();
Expand Down Expand Up @@ -206,6 +210,8 @@ class DeclarativeWebContainer : public QWindow, public QQmlParserStatus, protect
void historyModelChanged();
void applicationClosing();

void hasInitialUrlChanged();

protected:
bool eventFilter(QObject *obj, QEvent *event);
virtual void exposeEvent(QExposeEvent *event);
Expand Down