Fix desktop-id notification edge case (#12216)
* Fix desktop-id notification edge case * Extract-method platform_util::GetDesktopName() This removes duplicated code from libnotify_notifications.cc and atom/common/linux/application_info.cc. * Check for empty case in GetDesktopName(). * Move GetDesktopName() to brightray::util * Remove unnecessary changes in platform_util * Add a brightray::platform_util namespace
This commit is contained in:
parent
86af20ded0
commit
dd2c2660b9
5 changed files with 62 additions and 8 deletions
24
brightray/common/platform_util.h
Normal file
24
brightray/common/platform_util.h
Normal file
|
@ -0,0 +1,24 @@
|
|||
// Copyright (c) 2018 GitHub, Inc.
|
||||
// Use of this source code is governed by the MIT license that can be
|
||||
// found in the LICENSE file.
|
||||
|
||||
#ifndef BRIGHTRAY_COMMON_PLATFORM_UTIL_H_
|
||||
#define BRIGHTRAY_COMMON_PLATFORM_UTIL_H_
|
||||
|
||||
#include <string>
|
||||
|
||||
namespace brightray {
|
||||
|
||||
namespace platform_util {
|
||||
|
||||
#if defined(OS_LINUX)
|
||||
// Returns a success flag.
|
||||
// Unlike libgtkui, does *not* use "chromium-browser.desktop" as a fallback.
|
||||
bool GetDesktopName(std::string* setme);
|
||||
#endif
|
||||
|
||||
} // namespace platform_util
|
||||
|
||||
} // namespace brightray
|
||||
|
||||
#endif // BRIGHTRAY_COMMON_PLATFORM_UTIL_H_
|
Loading…
Add table
Add a link
Reference in a new issue