summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorpiman <piman@chromium.org>2015-11-17 15:56:46 -0800
committerCommit bot <commit-bot@chromium.org>2015-11-17 23:57:50 +0000
commitc35e8b8ea98435d459c589f546abd638f1e6dc53 (patch)
tree1958ba3efc02e3078b5dbb90299121b01ae3dd78
parent48119fbc08743314f066f2ecc18c76533b44e2d4 (diff)
downloadchromium_src-c35e8b8ea98435d459c589f546abd638f1e6dc53.zip
chromium_src-c35e8b8ea98435d459c589f546abd638f1e6dc53.tar.gz
chromium_src-c35e8b8ea98435d459c589f546abd638f1e6dc53.tar.bz2
X11: Set bit gravity to NorthWestGravity
Attempting to reduce the amount of flashing during resize. BUG=326995 Review URL: https://codereview.chromium.org/1459443003 Cr-Commit-Position: refs/heads/master@{#360209}
-rw-r--r--ui/aura/window_tree_host_x11.cc3
-rw-r--r--ui/gl/gl_surface_glx.cc6
-rw-r--r--ui/platform_window/x11/x11_window.cc3
-rw-r--r--ui/views/widget/desktop_aura/desktop_window_tree_host_x11.cc3
4 files changed, 11 insertions, 4 deletions
diff --git a/ui/aura/window_tree_host_x11.cc b/ui/aura/window_tree_host_x11.cc
index 7f2c720..e1abcac 100644
--- a/ui/aura/window_tree_host_x11.cc
+++ b/ui/aura/window_tree_host_x11.cc
@@ -218,6 +218,7 @@ WindowTreeHostX11::WindowTreeHostX11(const gfx::Rect& bounds)
XSetWindowAttributes swa;
memset(&swa, 0, sizeof(swa));
swa.background_pixmap = None;
+ swa.bit_gravity = NorthWestGravity;
swa.override_redirect = default_override_redirect;
xwindow_ = XCreateWindow(
xdisplay_, x_root_window_,
@@ -226,7 +227,7 @@ WindowTreeHostX11::WindowTreeHostX11(const gfx::Rect& bounds)
CopyFromParent, // depth
InputOutput,
CopyFromParent, // visual
- CWBackPixmap | CWOverrideRedirect,
+ CWBackPixmap | CWBitGravity | CWOverrideRedirect,
&swa);
if (ui::PlatformEventSource::GetInstance())
ui::PlatformEventSource::GetInstance()->AddPlatformEventDispatcher(this);
diff --git a/ui/gl/gl_surface_glx.cc b/ui/gl/gl_surface_glx.cc
index e66e637..f94f064 100644
--- a/ui/gl/gl_surface_glx.cc
+++ b/ui/gl/gl_surface_glx.cc
@@ -477,9 +477,13 @@ bool NativeViewGLSurfaceGLX::Initialize() {
// extra blits in the driver), that we can resize exactly in Resize(),
// correctly ordered with GL, so that we don't have invalid transient states.
// See https://crbug.com/326995.
+ XSetWindowAttributes swa;
+ memset(&swa, 0, sizeof(swa));
+ swa.background_pixmap = 0;
+ swa.bit_gravity = NorthWestGravity;
window_ = XCreateWindow(g_display, parent_window_, 0, 0, size_.width(),
size_.height(), 0, CopyFromParent, InputOutput,
- CopyFromParent, 0, nullptr);
+ CopyFromParent, CWBackPixmap | CWBitGravity, &swa);
XMapWindow(g_display, window_);
ui::PlatformEventSource* event_source =
diff --git a/ui/platform_window/x11/x11_window.cc b/ui/platform_window/x11/x11_window.cc
index 91af8ed..073fe4da 100644
--- a/ui/platform_window/x11/x11_window.cc
+++ b/ui/platform_window/x11/x11_window.cc
@@ -126,6 +126,7 @@ void X11Window::Show() {
XSetWindowAttributes swa;
memset(&swa, 0, sizeof(swa));
swa.background_pixmap = None;
+ swa.bit_gravity = NorthWestGravity;
swa.override_redirect = g_override_redirect;
xwindow_ = XCreateWindow(xdisplay_,
xroot_window_,
@@ -137,7 +138,7 @@ void X11Window::Show() {
CopyFromParent, // depth
InputOutput,
CopyFromParent, // visual
- CWBackPixmap | CWOverrideRedirect,
+ CWBackPixmap | CWBitGravity | CWOverrideRedirect,
&swa);
long event_mask = ButtonPressMask | ButtonReleaseMask | FocusChangeMask |
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 298c92b..d02dede 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
@@ -1084,10 +1084,11 @@ void DesktopWindowTreeHostX11::OnCursorVisibilityChangedNative(bool show) {
void DesktopWindowTreeHostX11::InitX11Window(
const Widget::InitParams& params) {
- unsigned long attribute_mask = CWBackPixmap;
+ unsigned long attribute_mask = CWBackPixmap | CWBitGravity;
XSetWindowAttributes swa;
memset(&swa, 0, sizeof(swa));
swa.background_pixmap = None;
+ swa.bit_gravity = NorthWestGravity;
::Atom window_type;
switch (params.type) {