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

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

Issue 1934413002: Revert of x11: Don't wait on a MapNotify on override-redirect windows. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 8 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 39aad4945ec208e406acd0d8f561894924b8675d..d827e3bbc8232e65f49cf52ab82a64e00c62f135 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
@@ -166,7 +166,6 @@
window_mapped_(false),
is_fullscreen_(false),
is_always_on_top_(false),
- is_override_redirect_(false),
use_native_frame_(false),
should_maximize_after_map_(false),
use_argb_visual_(false),
@@ -970,11 +969,6 @@
if (window_mapped_) {
XWithdrawWindow(xdisplay_, xwindow_, 0);
window_mapped_ = false;
- if (is_override_redirect_) {
- // If we're override-redirect, we won't receive an UnmapNotify message,
- // so run the unmap handler directly.
- OnX11WindowUnmapped();
- }
}
native_widget_delegate_->OnNativeWidgetVisibilityChanged(false);
}
@@ -1128,8 +1122,6 @@
if (swa.override_redirect)
attribute_mask |= CWOverrideRedirect;
-
- is_override_redirect_ = swa.override_redirect;
Visual* visual;
int depth;
@@ -1388,38 +1380,6 @@
} else {
native_window_frame_borders_in_pixels_ = gfx::Insets();
}
-}
-
-void DesktopWindowTreeHostX11::OnX11WindowMapped() {
- if (!window_mapped_) {
- window_mapped_ = true;
-
- FOR_EACH_OBSERVER(DesktopWindowTreeHostObserverX11,
- observer_list_,
- OnWindowMapped(xwindow_));
-
- UpdateMinAndMaxSize();
-
- // Some WMs only respect maximize hints after the window has been mapped.
- // Check whether we need to re-do a maximization.
- if (should_maximize_after_map_) {
- Maximize();
- should_maximize_after_map_ = false;
- }
- }
-
- // If we're an override redirect window, we need to perform a full redraw
- // because on AMD drivers we might get a MapNotify event after performing the
- // initial draw, which can result in a blank window. crbug.com/606661.
- if (is_override_redirect_)
- compositor()->ScheduleFullRedraw();
-}
-
-void DesktopWindowTreeHostX11::OnX11WindowUnmapped() {
- window_mapped_ = false;
- FOR_EACH_OBSERVER(DesktopWindowTreeHostObserverX11,
- observer_list_,
- OnWindowUnmapped(xwindow_));
}
void DesktopWindowTreeHostX11::UpdateMinAndMaxSize() {
@@ -1694,17 +1654,12 @@
}
XMapWindow(xdisplay_, xwindow_);
- if (is_override_redirect_) {
- // Override redirect windows don't get routed through the window manager;
- // we won't reliably get a MapNotify.
- OnX11WindowMapped();
- } else {
- // We now block until our window is mapped. Some X11 APIs will crash and
- // burn if passed |xwindow_| before the window is mapped, and XMapWindow is
- // asynchronous.
- if (ui::X11EventSource::GetInstance())
- ui::X11EventSource::GetInstance()->BlockUntilWindowMapped(xwindow_);
- }
+
+ // We now block until our window is mapped. Some X11 APIs will crash and
+ // burn if passed |xwindow_| before the window is mapped, and XMapWindow is
+ // asynchronous.
+ if (ui::X11EventSource::GetInstance())
+ ui::X11EventSource::GetInstance()->BlockUntilWindowMapped(xwindow_);
}
void DesktopWindowTreeHostX11::SetWindowTransparency() {
@@ -1918,11 +1873,27 @@
break;
}
case MapNotify: {
- OnX11WindowMapped();
+ window_mapped_ = true;
+
+ FOR_EACH_OBSERVER(DesktopWindowTreeHostObserverX11,
+ observer_list_,
+ OnWindowMapped(xwindow_));
+
+ UpdateMinAndMaxSize();
+
+ // Some WMs only respect maximize hints after the window has been mapped.
+ // Check whether we need to re-do a maximization.
+ if (should_maximize_after_map_) {
+ Maximize();
+ should_maximize_after_map_ = false;
+ }
+
break;
}
case UnmapNotify: {
- OnX11WindowUnmapped();
+ FOR_EACH_OBSERVER(DesktopWindowTreeHostObserverX11,
+ observer_list_,
+ OnWindowUnmapped(xwindow_));
break;
}
case ClientMessage: {
« 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