]> git.lyx.org Git - lyx.git/blobdiff - src/frontends/Application.C
* src/frontends/qt4/GuiSelection.C
[lyx.git] / src / frontends / Application.C
index 0f3fa8c2d8cac19db706d860f790c20c586e0e7f..35eeaa9418dcf26bedfec3180d63a32eed2263d0 100644 (file)
@@ -22,7 +22,7 @@
 
 #include "funcrequest.h"
 #include "FuncStatus.h"
-#include "lyx_main.h"
+#include "lyx_main.h"  // for lyx::use_gui
 #include "lyxfont.h"
 #include "lyxfunc.h"
 #include "lyxrc.h"
@@ -39,6 +39,7 @@ namespace frontend {
 
 
 Application::Application(int &, char **)
+       : current_view_(0)
 {
        // FIXME: please confirm: with unicode, I think initEncoding()
        // is not needed anymore!
@@ -49,11 +50,11 @@ Application::Application(int &, char **)
 
 
 LyXView & Application::createView(unsigned int width,
-                                                                 unsigned int height,
-                                                                 int posx, int posy,
-                                                                 bool maximize,
-                                                                 unsigned int iconSizeXY,
-                                                                 const std::string & geometryArg)
+                                 unsigned int height,
+                                 int posx, int posy,
+                                 bool maximize,
+                                 unsigned int iconSizeXY,
+                                 const std::string & geometryArg)
 {
        LyXView & view = gui().createRegisteredView();
        int view_id = view.id();
@@ -64,6 +65,7 @@ LyXView & Application::createView(unsigned int width,
 
        view.init();
        view.setGeometry(width, height, posx, posy, maximize, iconSizeXY, geometryArg);
+       view.setFocus();
 
        setCurrentView(view);
 
@@ -71,15 +73,15 @@ LyXView & Application::createView(unsigned int width,
 }
 
 
-LyXView const & Application::currentView() const
+LyXView const * Application::currentView() const
 {
-       return *current_view_;
+       return current_view_;
 }
 
 
-LyXView & Application::currentView()
+LyXView * Application::currentView()
 {
-       return *current_view_;
+       return current_view_;
 }