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

Side by Side Diff: ui/views/widget/desktop_aura/desktop_window_tree_host_x11.cc

Issue 1901813002: Revert "Add a crash for debugging when we get into a bad state." (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 unified diff | 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 »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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/Xatom.h> 7 #include <X11/Xatom.h>
8 #include <X11/Xregion.h> 8 #include <X11/Xregion.h>
9 #include <X11/Xutil.h> 9 #include <X11/Xutil.h>
10 #include <X11/extensions/XInput2.h> 10 #include <X11/extensions/XInput2.h>
(...skipping 1635 matching lines...) Expand 10 before | Expand all | Expand 10 after
1646 XChangeProperty(xdisplay_, 1646 XChangeProperty(xdisplay_,
1647 xwindow_, 1647 xwindow_,
1648 atom_cache_.GetAtom("_NET_WM_USER_TIME"), 1648 atom_cache_.GetAtom("_NET_WM_USER_TIME"),
1649 XA_CARDINAL, 1649 XA_CARDINAL,
1650 32, 1650 32,
1651 PropModeReplace, 1651 PropModeReplace,
1652 reinterpret_cast<const unsigned char *>(&wm_user_time_ms), 1652 reinterpret_cast<const unsigned char *>(&wm_user_time_ms),
1653 1); 1653 1);
1654 } 1654 }
1655 1655
1656 x_map_window_was_called_ = true;
1657 XMapWindow(xdisplay_, xwindow_); 1656 XMapWindow(xdisplay_, xwindow_);
1658 1657
1659 // We now block until our window is mapped. Some X11 APIs will crash and 1658 // We now block until our window is mapped. Some X11 APIs will crash and
1660 // burn if passed |xwindow_| before the window is mapped, and XMapWindow is 1659 // burn if passed |xwindow_| before the window is mapped, and XMapWindow is
1661 // asynchronous. 1660 // asynchronous.
1662 if (ui::X11EventSource::GetInstance()) 1661 if (ui::X11EventSource::GetInstance())
1663 ui::X11EventSource::GetInstance()->BlockUntilWindowMapped(xwindow_); 1662 ui::X11EventSource::GetInstance()->BlockUntilWindowMapped(xwindow_);
1664 window_mapped_ = true; 1663 window_mapped_ = true;
1665 x_map_window_was_called_ = false;
1666 1664
1667 UpdateMinAndMaxSize(); 1665 UpdateMinAndMaxSize();
1668 1666
1669 // Some WMs only respect maximize hints after the window has been mapped. 1667 // Some WMs only respect maximize hints after the window has been mapped.
1670 // Check whether we need to re-do a maximization. 1668 // Check whether we need to re-do a maximization.
1671 if (should_maximize_after_map_) { 1669 if (should_maximize_after_map_) {
1672 Maximize(); 1670 Maximize();
1673 should_maximize_after_map_ = false; 1671 should_maximize_after_map_ = false;
1674 } 1672 }
1675 } 1673 }
(...skipping 202 matching lines...) Expand 10 before | Expand all | Expand 10 after
1878 default: 1876 default:
1879 NOTREACHED(); 1877 NOTREACHED();
1880 } 1878 }
1881 1879
1882 // If we coalesced an event we need to free its cookie. 1880 // If we coalesced an event we need to free its cookie.
1883 if (num_coalesced > 0) 1881 if (num_coalesced > 0)
1884 XFreeEventData(xev->xgeneric.display, &last_event.xcookie); 1882 XFreeEventData(xev->xgeneric.display, &last_event.xcookie);
1885 break; 1883 break;
1886 } 1884 }
1887 case MapNotify: { 1885 case MapNotify: {
1888 CHECK(x_map_window_was_called_)
1889 << "Received MapNotify event despite never calling XMapWindow(). "
1890 << "(This is debugging state for crbug.com/381732.)";
1891
1892 FOR_EACH_OBSERVER(DesktopWindowTreeHostObserverX11, 1886 FOR_EACH_OBSERVER(DesktopWindowTreeHostObserverX11,
1893 observer_list_, 1887 observer_list_,
1894 OnWindowMapped(xwindow_)); 1888 OnWindowMapped(xwindow_));
1895 break; 1889 break;
1896 } 1890 }
1897 case UnmapNotify: { 1891 case UnmapNotify: {
1898 FOR_EACH_OBSERVER(DesktopWindowTreeHostObserverX11, 1892 FOR_EACH_OBSERVER(DesktopWindowTreeHostObserverX11,
1899 observer_list_, 1893 observer_list_,
1900 OnWindowUnmapped(xwindow_)); 1894 OnWindowUnmapped(xwindow_));
1901 break; 1895 break;
(...skipping 141 matching lines...) Expand 10 before | Expand all | Expand 10 after
2043 if (linux_ui) { 2037 if (linux_ui) {
2044 ui::NativeTheme* native_theme = linux_ui->GetNativeTheme(window); 2038 ui::NativeTheme* native_theme = linux_ui->GetNativeTheme(window);
2045 if (native_theme) 2039 if (native_theme)
2046 return native_theme; 2040 return native_theme;
2047 } 2041 }
2048 2042
2049 return ui::NativeThemeAura::instance(); 2043 return ui::NativeThemeAura::instance();
2050 } 2044 }
2051 2045
2052 } // namespace views 2046 } // namespace views
OLDNEW
« 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