diff --git a/src/servers/notification/NotificationWindow.cpp b/src/servers/notification/NotificationWindow.cpp index f00a5fdb3d..d94359942f 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;