[haiku-commits] r43173 - haiku/trunk/src/servers/notification

  • From: pulkomandy@xxxxxxxxxxxxxxxxx
  • To: haiku-commits@xxxxxxxxxxxxx
  • Date: Thu, 3 Nov 2011 23:17:00 +0100 (CET)

Author: pulkomandy
Date: 2011-11-03 23:16:59 +0100 (Thu, 03 Nov 2011)
New Revision: 43173
Changeset: https://dev.haiku-os.org/changeset/43173

Modified:
   haiku/trunk/src/servers/notification/NotificationWindow.cpp
   haiku/trunk/src/servers/notification/NotificationWindow.h
Log:
Calling Show() in the constructor unlocks the Looper, so calling SetPosition 
after that doesn't work.
Tweak the code around as it doesn't really have to be done there :
  * Remove the Show() method override
  * Make sure the window is layouted and moved to the right place before 
showing it (which is what this early SetPosition call attempted to do)


Modified: haiku/trunk/src/servers/notification/NotificationWindow.cpp
===================================================================
--- haiku/trunk/src/servers/notification/NotificationWindow.cpp 2011-11-03 
22:15:20 UTC (rev 43172)
+++ haiku/trunk/src/servers/notification/NotificationWindow.cpp 2011-11-03 
22:16:59 UTC (rev 43173)
@@ -190,7 +190,6 @@
                                        group->AddInfo(view);
 
                                        _ResizeAll();
-                                       SetPosition();
 
                                        reply.AddInt32("error", B_OK);
                                } else
@@ -215,7 +214,6 @@
                                fViews.erase(it);
 
                        _ResizeAll();
-                       SetPosition();
                        break;
                }
                default:
@@ -294,12 +292,6 @@
 void
 NotificationWindow::_ResizeAll()
 {
-       if (fAppViews.empty()) {
-               if (!IsHidden())
-                       Hide();
-               return;
-       }
-
        appview_t::iterator aIt;
        bool shouldHide = true;
 
@@ -317,9 +309,6 @@
                return;
        }
 
-       if (IsHidden())
-               Show();
-
        for (aIt = fAppViews.begin(); aIt != fAppViews.end(); aIt++) {
                AppGroupView* view = aIt->second;
 
@@ -331,6 +320,11 @@
                                view->Show();
                }
        }
+
+       SetPosition();
+
+       if (IsHidden())
+               Show();
 }
 
 
@@ -467,13 +461,6 @@
 }
 
 
-void NotificationWindow::Show()
-{
-       BWindow::Show();
-       SetPosition();
-}
-
-
 void
 NotificationWindow::_LoadGeneralSettings(bool startMonitor)
 {

Modified: haiku/trunk/src/servers/notification/NotificationWindow.h
===================================================================
--- haiku/trunk/src/servers/notification/NotificationWindow.h   2011-11-03 
22:15:20 UTC (rev 43172)
+++ haiku/trunk/src/servers/notification/NotificationWindow.h   2011-11-03 
22:16:59 UTC (rev 43173)
@@ -48,8 +48,6 @@
        virtual BHandler*                               
ResolveSpecifier(BMessage*, int32, BMessage*,
                                                                                
int32, const char*);
                                                                                
-                       void                                    Show();
-
                        icon_size                               IconSize();
                        int32                                   Timeout();
                        float                                   Width();


Other related posts:

  • » [haiku-commits] r43173 - haiku/trunk/src/servers/notification - pulkomandy