[haiku-commits] haiku: hrev51706 - src/servers/notification

  • From: waddlesplash@xxxxxxxxx
  • To: haiku-commits@xxxxxxxxxxxxx
  • Date: Sun, 24 Dec 2017 18:04:51 +0100 (CET)

hrev51706 adds 1 changeset to branch 'master'
old head: ab75d3b5a83bf2a3b2fecfeb84d739c7cdc1a5de
new head: 726fb6c4416276caa98d6655eaf6759d3a4b5925
overview: 
http://cgit.haiku-os.org/haiku/log/?qt=range&q=726fb6c44162+%5Eab75d3b5a83b

----------------------------------------------------------------------------

726fb6c44162: notification_server: Fix x86_64 build (missing parentheses).

                              [ Augustin Cavalier <waddlesplash@xxxxxxxxx> ]

----------------------------------------------------------------------------

Revision:    hrev51706
Commit:      726fb6c4416276caa98d6655eaf6759d3a4b5925
URL:         http://cgit.haiku-os.org/haiku/commit/?id=726fb6c44162
Author:      Augustin Cavalier <waddlesplash@xxxxxxxxx>
Date:        Sun Dec 24 17:04:26 2017 UTC

----------------------------------------------------------------------------

1 file changed, 17 insertions(+), 18 deletions(-)
src/servers/notification/NotificationWindow.cpp | 35 ++++++++++-----------

----------------------------------------------------------------------------

diff --git a/src/servers/notification/NotificationWindow.cpp 
b/src/servers/notification/NotificationWindow.cpp
index f00a5fd..d943599 100644
--- a/src/servers/notification/NotificationWindow.cpp
+++ b/src/servers/notification/NotificationWindow.cpp
@@ -39,7 +39,7 @@
 
 
 property_info main_prop_list[] = {
-       {"message", {B_GET_PROPERTY, 0}, {B_INDEX_SPECIFIER, 0}, 
+       {"message", {B_GET_PROPERTY, 0}, {B_INDEX_SPECIFIER, 0},
                "get a message"},
        {"message", {B_COUNT_PROPERTIES, 0}, {B_DIRECT_SPECIFIER, 0},
                "count messages"},
@@ -53,30 +53,30 @@ property_info main_prop_list[] = {
 
 
 /**
- * Checks if notification position overlaps with 
+ * Checks if notification position overlaps with
  * deskbar position
  */
 static bool
-is_overlapping(deskbar_location deskbar, 
+is_overlapping(deskbar_location deskbar,
                uint32 notification) {
-       if (deskbar == B_DESKBAR_RIGHT_TOP 
+       if (deskbar == B_DESKBAR_RIGHT_TOP
                        && notification == (B_FOLLOW_RIGHT | B_FOLLOW_TOP))
                return true;
-       if (deskbar == B_DESKBAR_RIGHT_BOTTOM 
+       if (deskbar == B_DESKBAR_RIGHT_BOTTOM
                        && notification == (B_FOLLOW_RIGHT | B_FOLLOW_BOTTOM))
                return true;
-       if (deskbar == B_DESKBAR_LEFT_TOP 
+       if (deskbar == B_DESKBAR_LEFT_TOP
                        && notification == (B_FOLLOW_LEFT | B_FOLLOW_TOP))
                return true;
-       if (deskbar == B_DESKBAR_LEFT_BOTTOM 
+       if (deskbar == B_DESKBAR_LEFT_BOTTOM
                        && notification == (B_FOLLOW_LEFT | B_FOLLOW_BOTTOM))
                return true;
        if (deskbar == B_DESKBAR_TOP
-                       && (notification == (B_FOLLOW_LEFT | B_FOLLOW_TOP) 
+                       && (notification == (B_FOLLOW_LEFT | B_FOLLOW_TOP)
                        || notification == (B_FOLLOW_RIGHT | B_FOLLOW_TOP)))
                return true;
        if (deskbar == B_DESKBAR_BOTTOM
-                       && (notification == (B_FOLLOW_LEFT | B_FOLLOW_BOTTOM) 
+                       && (notification == (B_FOLLOW_LEFT | B_FOLLOW_BOTTOM)
                        || notification == (B_FOLLOW_RIGHT | B_FOLLOW_BOTTOM)))
                return true;
        return false;
@@ -85,10 +85,10 @@ is_overlapping(deskbar_location deskbar,
 
 NotificationWindow::NotificationWindow()
        :
-       BWindow(BRect(0, 0, -1, -1), B_TRANSLATE_MARK("Notification"), 
+       BWindow(BRect(0, 0, -1, -1), B_TRANSLATE_MARK("Notification"),
                B_BORDERED_WINDOW_LOOK, B_FLOATING_ALL_WINDOW_FEEL, 
B_AVOID_FRONT
                | B_AVOID_FOCUS | B_NOT_CLOSABLE | B_NOT_ZOOMABLE | 
B_NOT_MINIMIZABLE
-               | B_NOT_RESIZABLE | B_NOT_MOVABLE | B_AUTO_UPDATE_SIZE_LIMITS, 
+               | B_NOT_RESIZABLE | B_NOT_MOVABLE | B_AUTO_UPDATE_SIZE_LIMITS,
                B_ALL_WORKSPACES),
        fShouldRun(true)
 {
@@ -98,7 +98,7 @@ NotificationWindow::NotificationWindow()
        result = cacheDir.SetTo(fCachePath.Path());
        if (result == B_ENTRY_NOT_FOUND)
                cacheDir.CreateDirectory(fCachePath.Path(), NULL);
-       
+
        SetLayout(new BGroupLayout(B_VERTICAL, 0));
 
        _LoadSettings(true);
@@ -181,7 +181,7 @@ NotificationWindow::MessageReceived(BMessage* message)
                                bool allow = false;
                                appfilter_t::iterator it = fAppFilters
                                        .find(sourceSignature.String());
-                               
+
                                AppUsage* appUsage = NULL;
                                if (it == fAppFilters.end()) {
                                        if (sourceSignature.Length() > 0
@@ -305,7 +305,7 @@ NotificationWindow::SetPosition()
        float rightOffset = bounds.right - Frame().right;
        float bottomOffset = bounds.bottom - Frame().bottom;
                // Size of the borders around the window
-       
+
        float x = Frame().left;
        float y = Frame().top;
                // If we cant guess, don't move...
@@ -320,21 +320,20 @@ NotificationWindow::SetPosition()
                        : fPosition;
 
 
-       if (position == B_FOLLOW_DESKBAR)
-       {
+       if (position == B_FOLLOW_DESKBAR) {
                BRect frame = deskbar.Frame();
                switch (deskbar.Location()) {
                        case B_DESKBAR_TOP:
                                // In case of overlapping here or for bottom
                                // use user's notification position
                                y = frame.bottom + topOffset;
-                               x = (fPosition == B_FOLLOW_LEFT | B_FOLLOW_TOP)
+                               x = (fPosition == (B_FOLLOW_LEFT | 
B_FOLLOW_TOP))
                                        ? frame.left + rightOffset
                                        : frame.right - width + rightOffset;
                                break;
                        case B_DESKBAR_BOTTOM:
                                y = frame.top - height - bottomOffset;
-                               x = (fPosition == B_FOLLOW_LEFT | 
B_FOLLOW_BOTTOM)
+                               x = (fPosition == (B_FOLLOW_LEFT | 
B_FOLLOW_BOTTOM))
                                        ? frame.left + rightOffset
                                        : frame.right - width + rightOffset;
                                break;


Other related posts:

  • » [haiku-commits] haiku: hrev51706 - src/servers/notification - waddlesplash