Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(44)

Unified Diff: ui/views/widget/desktop_aura/desktop_window_tree_host_x11.cc

Issue 2709283003: Allow to open multiple modal file-pickers in Linux (Closed)
Patch Set: add DCHECK_GT Created 3 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « ui/views/widget/desktop_aura/desktop_window_tree_host_x11.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/views/widget/desktop_aura/desktop_window_tree_host_x11.cc
diff --git a/ui/views/widget/desktop_aura/desktop_window_tree_host_x11.cc b/ui/views/widget/desktop_aura/desktop_window_tree_host_x11.cc
index 10a5be82b6bec0d107525604555fcc9a446e6836..448baf898079c28dab37da1087c36257225f5e8c 100644
--- a/ui/views/widget/desktop_aura/desktop_window_tree_host_x11.cc
+++ b/ui/views/widget/desktop_aura/desktop_window_tree_host_x11.cc
@@ -206,7 +206,7 @@ DesktopWindowTreeHostX11::DesktopWindowTreeHostX11(
has_pointer_(false),
has_window_focus_(false),
has_pointer_focus_(false),
- modal_dialog_xid_(0),
+ modal_dialog_counter_(0),
close_widget_factory_(this),
weak_factory_(this) {}
@@ -2337,19 +2337,17 @@ gfx::Rect DesktopWindowTreeHostX11::ToPixelRect(
return gfx::ToEnclosingRect(rect_in_pixels);
}
-XID DesktopWindowTreeHostX11::GetModalDialog() {
- return modal_dialog_xid_;
-}
-
std::unique_ptr<base::Closure>
- DesktopWindowTreeHostX11::DisableEventListening(XID dialog) {
- DCHECK(dialog);
- DCHECK(!modal_dialog_xid_);
- modal_dialog_xid_ = dialog;
- // ScopedWindowTargeter is used to temporarily replace the event-targeter
- // with NullEventTargeter to make |dialog| modal.
- targeter_for_modal_.reset(new aura::ScopedWindowTargeter(window(),
- std::unique_ptr<ui::EventTargeter>(new ui::NullEventTargeter)));
+DesktopWindowTreeHostX11::DisableEventListening() {
+ // Allows to open multiple file-pickers. See https://crbug.com/678982
+ modal_dialog_counter_++;
+ if (modal_dialog_counter_ == 1) {
+ // ScopedWindowTargeter is used to temporarily replace the event-targeter
+ // with NullEventTargeter to make |dialog| modal.
+ targeter_for_modal_.reset(new aura::ScopedWindowTargeter(
+ window(),
+ std::unique_ptr<ui::EventTargeter>(new ui::NullEventTargeter)));
+ }
return base::MakeUnique<base::Closure>(base::Bind(
&DesktopWindowTreeHostX11::EnableEventListening,
@@ -2357,9 +2355,9 @@ std::unique_ptr<base::Closure>
}
void DesktopWindowTreeHostX11::EnableEventListening() {
- DCHECK(modal_dialog_xid_);
- modal_dialog_xid_ = 0;
- targeter_for_modal_.reset();
+ DCHECK_GT(modal_dialog_counter_, 0UL);
+ if (!--modal_dialog_counter_)
+ targeter_for_modal_.reset();
}
////////////////////////////////////////////////////////////////////////////////
« no previous file with comments | « ui/views/widget/desktop_aura/desktop_window_tree_host_x11.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698