Skip to content

Commit ccf9a51

Browse files
clavinckerr
authored andcommitted
1 parent 2abb5d1 commit ccf9a51

File tree

2 files changed

+7
-5
lines changed

2 files changed

+7
-5
lines changed

shell/browser/api/electron_api_screen.cc

+6-4
Original file line numberDiff line numberDiff line change
@@ -110,10 +110,12 @@ void Screen::OnDisplayAdded(const display::Display& new_display) {
110110
"display-added", new_display));
111111
}
112112

113-
void Screen::OnDisplayRemoved(const display::Display& old_display) {
114-
base::SingleThreadTaskRunner::GetCurrentDefault()->PostNonNestableTask(
115-
FROM_HERE, base::BindOnce(&DelayEmit, base::Unretained(this),
116-
"display-removed", old_display));
113+
void Screen::OnDisplaysRemoved(const display::Displays& old_displays) {
114+
for (const auto& old_display : old_displays) {
115+
base::SingleThreadTaskRunner::GetCurrentDefault()->PostNonNestableTask(
116+
FROM_HERE, base::BindOnce(&DelayEmit, base::Unretained(this),
117+
"display-removed", old_display));
118+
}
117119
}
118120

119121
void Screen::OnDisplayMetricsChanged(const display::Display& display,

shell/browser/api/electron_api_screen.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ class Screen : public gin::Wrappable<Screen>,
5757

5858
// display::DisplayObserver:
5959
void OnDisplayAdded(const display::Display& new_display) override;
60-
void OnDisplayRemoved(const display::Display& old_display) override;
60+
void OnDisplaysRemoved(const display::Displays& removed_displays) override;
6161
void OnDisplayMetricsChanged(const display::Display& display,
6262
uint32_t changed_metrics) override;
6363

0 commit comments

Comments
 (0)