hi,

having two windows and putting both of them into fullscreen mode results in 
loss of toolbars visibility configuration (basically because of sharing
toolbars info between lyx windows - 
http://bugzilla.lyx.org/show_bug.cgi?id=4588#c1 ).

attached is the workaround until the toolbars are separated per window.
if there wont be objections i'll put it in.

pavel
diff --git a/src/ToolbarBackend.cpp b/src/ToolbarBackend.cpp
index 34f3d5b..df3f51e 100644
--- a/src/ToolbarBackend.cpp
+++ b/src/ToolbarBackend.cpp
@@ -200,6 +200,7 @@ ToolbarInfo & ToolbarInfo::read(Lexer & lex)
 
 ToolbarBackend::ToolbarBackend()
 {
+       FullScreenWindows=0;
 }
 
 
diff --git a/src/ToolbarBackend.h b/src/ToolbarBackend.h
index cd4828e..97fee7a 100644
--- a/src/ToolbarBackend.h
+++ b/src/ToolbarBackend.h
@@ -135,6 +135,10 @@ public:
        ///
        ToolbarInfo * getUsedToolbarInfo(std::string const & name);
 
+       // FIXME should be deleted when every window has its own toolbar config.
+       /// number of toggleFullScreen calls, i.e. number of FullScreen windows.
+       int FullScreenWindows;
+
 private:
        /// all the defined toolbars
        Toolbars toolbars;
diff --git a/src/frontends/qt4/GuiToolbars.cpp 
b/src/frontends/qt4/GuiToolbars.cpp
index dd89ae6..c9c7e78 100644
--- a/src/frontends/qt4/GuiToolbars.cpp
+++ b/src/frontends/qt4/GuiToolbars.cpp
@@ -225,6 +225,10 @@ void GuiToolbars::toggleToolbarState(string const & name, 
bool allowauto)
 
 void GuiToolbars::toggleFullScreen(bool start_full_screen)
 {
+       // we need to know number of fullscreens until every
+       // LyXView has its own toolbar configuration
+       toolbarbackend.FullScreenWindows += start_full_screen ? 1 : -1;
+
        // extracts the toolbars from the backend
        ToolbarBackend::Toolbars::iterator cit = toolbarbackend.begin();
        ToolbarBackend::Toolbars::iterator end = toolbarbackend.end();
@@ -233,7 +237,8 @@ void GuiToolbars::toggleFullScreen(bool start_full_screen)
        for (; cit != end; ++cit) {
 
                if (start_full_screen) {
-                       flags = cit->before_fullscreen = cit->flags;
+                       if (toolbarbackend.FullScreenWindows == 1)
+                               flags = cit->before_fullscreen = cit->flags;
                        TurnOffFlag(ON);
                        TurnOffFlag(AUTO);
                        TurnOnFlag(OFF);

Reply via email to