| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "ui/views/widget/desktop_aura/desktop_window_tree_host_x11.h" | 5 #include "ui/views/widget/desktop_aura/desktop_window_tree_host_x11.h" |
| 6 | 6 |
| 7 #include <X11/extensions/shape.h> | 7 #include <X11/extensions/shape.h> |
| 8 #include <X11/extensions/XInput2.h> | 8 #include <X11/extensions/XInput2.h> |
| 9 #include <X11/Xatom.h> | 9 #include <X11/Xatom.h> |
| 10 #include <X11/Xregion.h> | 10 #include <X11/Xregion.h> |
| (...skipping 1228 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1239 // Propagate the window minimization information to the content window, so | 1239 // Propagate the window minimization information to the content window, so |
| 1240 // the render side can update its visibility properly. OnWMStateUpdated() is | 1240 // the render side can update its visibility properly. OnWMStateUpdated() is |
| 1241 // called by PropertyNofify event from DispatchEvent() when the browser is | 1241 // called by PropertyNofify event from DispatchEvent() when the browser is |
| 1242 // minimized or shown from minimized state. On Windows, this is realized by | 1242 // minimized or shown from minimized state. On Windows, this is realized by |
| 1243 // calling OnHostResized() with an empty size. In particular, | 1243 // calling OnHostResized() with an empty size. In particular, |
| 1244 // HWNDMessageHandler::GetClientAreaBounds() returns an empty size when the | 1244 // HWNDMessageHandler::GetClientAreaBounds() returns an empty size when the |
| 1245 // window is minimized. On Linux, returning empty size in GetBounds() or | 1245 // window is minimized. On Linux, returning empty size in GetBounds() or |
| 1246 // SetBounds() does not work. | 1246 // SetBounds() does not work. |
| 1247 bool is_minimized = IsMinimized(); | 1247 bool is_minimized = IsMinimized(); |
| 1248 if (is_minimized != was_minimized) { | 1248 if (is_minimized != was_minimized) { |
| 1249 if (is_minimized) | 1249 if (is_minimized) { |
| 1250 compositor()->SetBlockDrawing(true); |
| 1250 content_window_->Hide(); | 1251 content_window_->Hide(); |
| 1251 else | 1252 } else { |
| 1252 content_window_->Show(); | 1253 content_window_->Show(); |
| 1254 compositor()->SetBlockDrawing(false); |
| 1255 } |
| 1253 } | 1256 } |
| 1254 | 1257 |
| 1255 if (restored_bounds_.IsEmpty()) { | 1258 if (restored_bounds_.IsEmpty()) { |
| 1256 DCHECK(!IsFullscreen()); | 1259 DCHECK(!IsFullscreen()); |
| 1257 if (IsMaximized()) { | 1260 if (IsMaximized()) { |
| 1258 // The request that we become maximized originated from a different | 1261 // The request that we become maximized originated from a different |
| 1259 // process. |bounds_| already contains our maximized bounds. Do a best | 1262 // process. |bounds_| already contains our maximized bounds. Do a best |
| 1260 // effort attempt to get restored bounds by setting it to our previously | 1263 // effort attempt to get restored bounds by setting it to our previously |
| 1261 // set bounds (and if we get this wrong, we aren't any worse off since | 1264 // set bounds (and if we get this wrong, we aren't any worse off since |
| 1262 // we'd otherwise be returning our maximized bounds). | 1265 // we'd otherwise be returning our maximized bounds). |
| (...skipping 651 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1914 if (linux_ui) { | 1917 if (linux_ui) { |
| 1915 ui::NativeTheme* native_theme = linux_ui->GetNativeTheme(window); | 1918 ui::NativeTheme* native_theme = linux_ui->GetNativeTheme(window); |
| 1916 if (native_theme) | 1919 if (native_theme) |
| 1917 return native_theme; | 1920 return native_theme; |
| 1918 } | 1921 } |
| 1919 | 1922 |
| 1920 return ui::NativeTheme::instance(); | 1923 return ui::NativeTheme::instance(); |
| 1921 } | 1924 } |
| 1922 | 1925 |
| 1923 } // namespace views | 1926 } // namespace views |
| OLD | NEW |