refactor: use gdk_display_beep() on Linux (#44734)
* refactor: use gdk_display_beep() to beep on Linux * chore: make a stub declaration for gdk_display_beep() * chore: remove unused file electron_gtk.sigs * chore: remove unused #includes to make gn check happy
This commit is contained in:
parent
15c3064780
commit
85e2622b68
4 changed files with 10 additions and 17 deletions
|
@ -11,6 +11,8 @@
|
|||
#include <string>
|
||||
#include <vector>
|
||||
|
||||
#include <gdk/gdk.h>
|
||||
|
||||
#include "base/cancelable_callback.h"
|
||||
#include "base/containers/contains.h"
|
||||
#include "base/environment.h"
|
||||
|
@ -32,6 +34,7 @@
|
|||
#include "dbus/bus.h"
|
||||
#include "dbus/message.h"
|
||||
#include "dbus/object_proxy.h"
|
||||
|
||||
#include "shell/common/platform_util_internal.h"
|
||||
#include "url/gurl.h"
|
||||
|
||||
|
@ -408,15 +411,8 @@ bool PlatformTrashItem(const base::FilePath& full_path, std::string* error) {
|
|||
} // namespace internal
|
||||
|
||||
void Beep() {
|
||||
// echo '\a' > /dev/console
|
||||
FILE* fp = fopen("/dev/console", "a");
|
||||
if (fp == nullptr) {
|
||||
fp = fopen("/dev/tty", "a");
|
||||
}
|
||||
if (fp != nullptr) {
|
||||
fprintf(fp, "\a");
|
||||
fclose(fp);
|
||||
}
|
||||
auto* display = gdk_display_get_default();
|
||||
gdk_display_beep(display);
|
||||
}
|
||||
|
||||
bool GetDesktopName(std::string* setme) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue