notification_server: Fix x86_64 build (missing parentheses).
This commit is contained in:
parent
ab75d3b5a8
commit
726fb6c441
@ -39,7 +39,7 @@
|
|||||||
|
|
||||||
|
|
||||||
property_info main_prop_list[] = {
|
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"},
|
"get a message"},
|
||||||
{"message", {B_COUNT_PROPERTIES, 0}, {B_DIRECT_SPECIFIER, 0},
|
{"message", {B_COUNT_PROPERTIES, 0}, {B_DIRECT_SPECIFIER, 0},
|
||||||
"count messages"},
|
"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
|
* deskbar position
|
||||||
*/
|
*/
|
||||||
static bool
|
static bool
|
||||||
is_overlapping(deskbar_location deskbar,
|
is_overlapping(deskbar_location deskbar,
|
||||||
uint32 notification) {
|
uint32 notification) {
|
||||||
if (deskbar == B_DESKBAR_RIGHT_TOP
|
if (deskbar == B_DESKBAR_RIGHT_TOP
|
||||||
&& notification == (B_FOLLOW_RIGHT | B_FOLLOW_TOP))
|
&& notification == (B_FOLLOW_RIGHT | B_FOLLOW_TOP))
|
||||||
return true;
|
return true;
|
||||||
if (deskbar == B_DESKBAR_RIGHT_BOTTOM
|
if (deskbar == B_DESKBAR_RIGHT_BOTTOM
|
||||||
&& notification == (B_FOLLOW_RIGHT | B_FOLLOW_BOTTOM))
|
&& notification == (B_FOLLOW_RIGHT | B_FOLLOW_BOTTOM))
|
||||||
return true;
|
return true;
|
||||||
if (deskbar == B_DESKBAR_LEFT_TOP
|
if (deskbar == B_DESKBAR_LEFT_TOP
|
||||||
&& notification == (B_FOLLOW_LEFT | B_FOLLOW_TOP))
|
&& notification == (B_FOLLOW_LEFT | B_FOLLOW_TOP))
|
||||||
return true;
|
return true;
|
||||||
if (deskbar == B_DESKBAR_LEFT_BOTTOM
|
if (deskbar == B_DESKBAR_LEFT_BOTTOM
|
||||||
&& notification == (B_FOLLOW_LEFT | B_FOLLOW_BOTTOM))
|
&& notification == (B_FOLLOW_LEFT | B_FOLLOW_BOTTOM))
|
||||||
return true;
|
return true;
|
||||||
if (deskbar == B_DESKBAR_TOP
|
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)))
|
|| notification == (B_FOLLOW_RIGHT | B_FOLLOW_TOP)))
|
||||||
return true;
|
return true;
|
||||||
if (deskbar == B_DESKBAR_BOTTOM
|
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)))
|
|| notification == (B_FOLLOW_RIGHT | B_FOLLOW_BOTTOM)))
|
||||||
return true;
|
return true;
|
||||||
return false;
|
return false;
|
||||||
@ -85,10 +85,10 @@ is_overlapping(deskbar_location deskbar,
|
|||||||
|
|
||||||
NotificationWindow::NotificationWindow()
|
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_BORDERED_WINDOW_LOOK, B_FLOATING_ALL_WINDOW_FEEL, B_AVOID_FRONT
|
||||||
| B_AVOID_FOCUS | B_NOT_CLOSABLE | B_NOT_ZOOMABLE | B_NOT_MINIMIZABLE
|
| 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),
|
B_ALL_WORKSPACES),
|
||||||
fShouldRun(true)
|
fShouldRun(true)
|
||||||
{
|
{
|
||||||
@ -98,7 +98,7 @@ NotificationWindow::NotificationWindow()
|
|||||||
result = cacheDir.SetTo(fCachePath.Path());
|
result = cacheDir.SetTo(fCachePath.Path());
|
||||||
if (result == B_ENTRY_NOT_FOUND)
|
if (result == B_ENTRY_NOT_FOUND)
|
||||||
cacheDir.CreateDirectory(fCachePath.Path(), NULL);
|
cacheDir.CreateDirectory(fCachePath.Path(), NULL);
|
||||||
|
|
||||||
SetLayout(new BGroupLayout(B_VERTICAL, 0));
|
SetLayout(new BGroupLayout(B_VERTICAL, 0));
|
||||||
|
|
||||||
_LoadSettings(true);
|
_LoadSettings(true);
|
||||||
@ -181,7 +181,7 @@ NotificationWindow::MessageReceived(BMessage* message)
|
|||||||
bool allow = false;
|
bool allow = false;
|
||||||
appfilter_t::iterator it = fAppFilters
|
appfilter_t::iterator it = fAppFilters
|
||||||
.find(sourceSignature.String());
|
.find(sourceSignature.String());
|
||||||
|
|
||||||
AppUsage* appUsage = NULL;
|
AppUsage* appUsage = NULL;
|
||||||
if (it == fAppFilters.end()) {
|
if (it == fAppFilters.end()) {
|
||||||
if (sourceSignature.Length() > 0
|
if (sourceSignature.Length() > 0
|
||||||
@ -305,7 +305,7 @@ NotificationWindow::SetPosition()
|
|||||||
float rightOffset = bounds.right - Frame().right;
|
float rightOffset = bounds.right - Frame().right;
|
||||||
float bottomOffset = bounds.bottom - Frame().bottom;
|
float bottomOffset = bounds.bottom - Frame().bottom;
|
||||||
// Size of the borders around the window
|
// Size of the borders around the window
|
||||||
|
|
||||||
float x = Frame().left;
|
float x = Frame().left;
|
||||||
float y = Frame().top;
|
float y = Frame().top;
|
||||||
// If we cant guess, don't move...
|
// If we cant guess, don't move...
|
||||||
@ -320,21 +320,20 @@ NotificationWindow::SetPosition()
|
|||||||
: fPosition;
|
: fPosition;
|
||||||
|
|
||||||
|
|
||||||
if (position == B_FOLLOW_DESKBAR)
|
if (position == B_FOLLOW_DESKBAR) {
|
||||||
{
|
|
||||||
BRect frame = deskbar.Frame();
|
BRect frame = deskbar.Frame();
|
||||||
switch (deskbar.Location()) {
|
switch (deskbar.Location()) {
|
||||||
case B_DESKBAR_TOP:
|
case B_DESKBAR_TOP:
|
||||||
// In case of overlapping here or for bottom
|
// In case of overlapping here or for bottom
|
||||||
// use user's notification position
|
// use user's notification position
|
||||||
y = frame.bottom + topOffset;
|
y = frame.bottom + topOffset;
|
||||||
x = (fPosition == B_FOLLOW_LEFT | B_FOLLOW_TOP)
|
x = (fPosition == (B_FOLLOW_LEFT | B_FOLLOW_TOP))
|
||||||
? frame.left + rightOffset
|
? frame.left + rightOffset
|
||||||
: frame.right - width + rightOffset;
|
: frame.right - width + rightOffset;
|
||||||
break;
|
break;
|
||||||
case B_DESKBAR_BOTTOM:
|
case B_DESKBAR_BOTTOM:
|
||||||
y = frame.top - height - bottomOffset;
|
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.left + rightOffset
|
||||||
: frame.right - width + rightOffset;
|
: frame.right - width + rightOffset;
|
||||||
break;
|
break;
|
||||||
|
Loading…
Reference in New Issue
Block a user