Skip to content

Commit

Permalink
Update pointer to current tab when the selected tab changes
Browse files Browse the repository at this point in the history
This allows requests like dumping the DOM tree to be forwarded to the
correct tab. Otherwise, the event would be forwarded to the most
recently created tab.
  • Loading branch information
trflynn89 authored and awesomekling committed Sep 13, 2022
1 parent 69ea291 commit 2ebaaf5
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions BrowserWindow.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
#include "Settings.h"
#include "SettingsDialog.h"
#include "WebView.h"
#include <AK/TypeCasts.h>
#include <QAction>
#include <QDialog>
#include <QPlainTextEdit>
Expand Down Expand Up @@ -190,6 +191,7 @@ BrowserWindow::BrowserWindow()
QObject::connect(m_tabs_container, &QTabWidget::currentChanged, [this](int index) {
setWindowTitle(QString("%1 - Ladybird").arg(m_tabs_container->tabText(index)));
setWindowIcon(m_tabs_container->tabIcon(index));
m_current_tab = verify_cast<Tab>(m_tabs_container->widget(index));
});
QObject::connect(m_tabs_container, &QTabWidget::tabCloseRequested, this, &BrowserWindow::close_tab);
QObject::connect(close_current_tab_action, &QAction::triggered, this, &BrowserWindow::close_current_tab);
Expand Down

0 comments on commit 2ebaaf5

Please sign in to comment.