}
+TabWorkArea * GuiView::currentTabWorkArea() const
+{
+ return d.currentTabWorkArea();
+}
+
+
GuiWorkArea * GuiView::currentWorkArea()
{
return d.current_work_area_;
void removeWorkArea(GuiWorkArea * work_area);
/// return true if \c wa is one of the visibles workareas of this view
bool hasVisibleWorkArea(GuiWorkArea * wa) const;
+ ///
+ TabWorkArea * currentTabWorkArea() const;
/// return the current WorkArea (the one that has the focus).
GuiWorkArea const * currentWorkArea() const;
/// return the current WorkArea (the one that has the focus).
this, SLOT(on_currentTabChanged(int)));
// Fix for #11835
QObject::connect(this, SIGNAL(tabBarClicked(int)),
- this, SLOT(on_currentTabChanged(int)));
+ this, SLOT(on_tabBarClicked(int)));
closeBufferButton = new QToolButton(this);
closeBufferButton->setPalette(pal);
}
+void TabWorkArea::on_tabBarClicked(int i)
+{
+ // returns e.g. on application destruction
+ if (i == -1)
+ return;
+
+ // if we click on a tab in a different TabWorkArea,
+ // focus needs to be set (#11835)
+ if (currentWorkArea() && currentWorkArea()->view().currentTabWorkArea() != this) {
+ GuiWorkArea * wa = workArea(i);
+ LASSERT(wa, return);
+ wa->setFocus();
+ }
+}
+
+
void TabWorkArea::on_currentTabChanged(int i)
{
// returns e.g. on application destruction
///
void on_currentTabChanged(int index);
///
+ void on_tabBarClicked(int index);
+ ///
void showContextMenu(const QPoint & pos);
/// enable closing tab on middle-click
void mousePressEvent(QMouseEvent * me) override;