]> git.lyx.org Git - lyx.git/blobdiff - src/frontends/qt4/GuiView.cpp
LFUN_CLOSE_TAB_GROUP: bug fixes.
[lyx.git] / src / frontends / qt4 / GuiView.cpp
index c51f7176bbcc1b231d681c97054633658125f455..42b96807048a8fc66e7641e82e788306be053ae0 100644 (file)
@@ -1827,8 +1827,15 @@ bool GuiView::dispatch(FuncRequest const & cmd)
                        break;
 
                case LFUN_CLOSE_TAB_GROUP:
-                       if (TabWorkArea * twa = d.currentTabWorkArea())
+                       if (TabWorkArea * twa = d.currentTabWorkArea()) {
                                delete twa;
+                               twa = d.currentTabWorkArea();
+                               // Switch to the next GuiWorkArea in the found TabWorkArea.
+                               d.current_work_area_ = twa? twa->currentWorkArea() : 0;
+                               if (d.splitter_->count() == 0)
+                                       // No more work area, switch to the background widget.
+                                       d.setBackground();
+                       }
                        break;
 
                default: