[gnote] Make get_main_window return active window



commit 1b38231c729caaf7b3ae6dc121b70e956d1f560f
Author: Aurimas Äernius <aurisc4 gmail com>
Date:   Mon Feb 11 22:48:47 2013 +0200

    Make get_main_window return active window

 src/gnote.cpp |    6 +++++-
 1 files changed, 5 insertions(+), 1 deletions(-)
---
diff --git a/src/gnote.cpp b/src/gnote.cpp
index 7917eda..cc51243 100644
--- a/src/gnote.cpp
+++ b/src/gnote.cpp
@@ -407,10 +407,14 @@ namespace gnote {
 
   MainWindow & Gnote::get_main_window()
   {
+    MainWindow *rc = get_active_window();
+    if(rc) {
+      return *rc;
+    }
     std::vector<Gtk::Window*> windows = Gtk::Window::list_toplevels();
     for(std::vector<Gtk::Window*>::iterator iter = windows.begin();
         iter != windows.end(); ++iter) {
-      MainWindow *rc = dynamic_cast<MainWindow*>(*iter);
+      rc = dynamic_cast<MainWindow*>(*iter);
       if(rc) {
         return *rc;
       }


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]