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

  • From: pulkomandy@xxxxxxxxxxxxxxxxx
  • To: haiku-commits@xxxxxxxxxxxxx
  • Date: Sat, 6 Aug 2011 12:41:45 +0200 (CEST)

Author: pulkomandy
Date: 2011-08-06 12:41:45 +0200 (Sat, 06 Aug 2011)
New Revision: 42587
Changeset: https://dev.haiku-os.org/changeset/42587
Ticket: https://dev.haiku-os.org/ticket/7011

Modified:
   haiku/trunk/src/servers/notification/NotificationWindow.cpp
   haiku/trunk/src/servers/notification/NotificationWindow.h
Log:
Ensure the window is at the right position before showing it. Fixes #7011.


Modified: haiku/trunk/src/servers/notification/NotificationWindow.cpp
===================================================================
--- haiku/trunk/src/servers/notification/NotificationWindow.cpp 2011-08-06 
09:05:55 UTC (rev 42586)
+++ haiku/trunk/src/servers/notification/NotificationWindow.cpp 2011-08-06 
10:41:45 UTC (rev 42587)
@@ -54,7 +54,7 @@
 
 NotificationWindow::NotificationWindow()
        :
-       BWindow(BRect(10, 10, 30, 30), B_TRANSLATE_MARK("Notification"), 
+       BWindow(BRect(0, 0, 0, 0), B_TRANSLATE_MARK("Notification"), 
                kLeftTitledWindowLook, B_FLOATING_ALL_WINDOW_FEEL, 
B_AVOID_FRONT | B_AVOID_FOCUS | B_NOT_CLOSABLE 
                | B_NOT_ZOOMABLE | B_NOT_MINIMIZABLE | B_NOT_RESIZABLE, 
                B_ALL_WORKSPACES)
@@ -63,6 +63,7 @@
 
        AddChild(fBorder);
 
+       SetPosition();
        Show();
        Hide();
 
@@ -363,13 +364,15 @@
        }
 
        ResizeTo(ViewWidth(), height);
-       PopupAnimation(Bounds().Width(), Bounds().Height());
+       PopupAnimation();
 }
 
 
 void
-NotificationWindow::PopupAnimation(float width, float height)
+NotificationWindow::SetPosition()
 {
+       float width = Bounds().Width();
+       float height = Bounds().Height();
        float x = 0, y = 0, sx, sy;
        float pad = 0;
        BDeskbar deskbar;
@@ -423,7 +426,13 @@
        }
 
        MoveTo(x, y);
+}
 
+void
+NotificationWindow::PopupAnimation()
+{
+       SetPosition();
+
        if (IsHidden() && fViews.size() != 0)
                Show();
        // Activate();// it hides floaters from apps :-(

Modified: haiku/trunk/src/servers/notification/NotificationWindow.h
===================================================================
--- haiku/trunk/src/servers/notification/NotificationWindow.h   2011-08-06 
09:05:55 UTC (rev 42586)
+++ haiku/trunk/src/servers/notification/NotificationWindow.h   2011-08-06 
10:41:45 UTC (rev 42587)
@@ -62,7 +62,8 @@
 private:
        friend class AppGroupView;
 
-                       void                                    
PopupAnimation(float, float);
+                       void                                    SetPosition();
+                       void                                    
PopupAnimation();
                        void                                    
LoadSettings(bool startMonitor = false);
                        void                                    
LoadAppFilters(bool startMonitor = false);
                        void                                    
SaveAppFilters();


Other related posts:

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