diff options
author | davidben@chromium.org <davidben@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-07-16 20:34:34 +0000 |
---|---|---|
committer | davidben@chromium.org <davidben@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-07-16 20:34:34 +0000 |
commit | 77f037650c26466d95ed6b138adff38873f0f7d9 (patch) | |
tree | f4da81f0c1170bb573fe82ad0ff051bb11f16f21 /app/x11_util.cc | |
parent | da02f52b7a55681e02e36acbcf2f54528f8b496b (diff) | |
download | chromium_src-77f037650c26466d95ed6b138adff38873f0f7d9.zip chromium_src-77f037650c26466d95ed6b138adff38873f0f7d9.tar.gz chromium_src-77f037650c26466d95ed6b138adff38873f0f7d9.tar.bz2 |
Fix crash bug in new SSLClientSocketPool.
We also need to push additional error state out of the SSLClientSocketPool on a ERR_SSL_CLIENT_AUTH_CERT_NEEDED error.
BUG=49197
TEST=no crash when visiting https://foafssl.org/srv/idp?authreqissuer=http://foaf.me/index.php
Committed: http://src.chromium.org/viewvc/chrome?view=rev&revision=52693
Review URL: http://codereview.chromium.org/2827053
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@52735 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'app/x11_util.cc')
-rw-r--r-- | app/x11_util.cc | 25 |
1 files changed, 23 insertions, 2 deletions
diff --git a/app/x11_util.cc b/app/x11_util.cc index 934e824..101815a 100644 --- a/app/x11_util.cc +++ b/app/x11_util.cc @@ -159,6 +159,10 @@ XID GetX11RootWindow() { return GDK_WINDOW_XID(gdk_get_default_root_window()); } +bool GetCurrentDesktop(int* desktop) { + return GetIntProperty(GetX11RootWindow(), "_NET_CURRENT_DESKTOP", desktop); +} + XID GetX11WindowFromGtkWidget(GtkWidget* widget) { return GDK_WINDOW_XID(widget->window); } @@ -192,7 +196,15 @@ int BitsPerPixelForPixmapDepth(Display* dpy, int depth) { bool IsWindowVisible(XID window) { XWindowAttributes win_attributes; XGetWindowAttributes(GetXDisplay(), window, &win_attributes); - return (win_attributes.map_state == IsViewable); + if (win_attributes.map_state != IsViewable) + return false; + // Some compositing window managers (notably kwin) do not actually unmap + // windows on desktop switch, so we also must check the current desktop. + int window_desktop, current_desktop; + return (!GetWindowDesktop(window, &window_desktop) || + !GetCurrentDesktop(¤t_desktop) || + window_desktop == kAllDesktops || + window_desktop == current_desktop); } bool GetWindowRect(XID window, gfx::Rect* rect) { @@ -342,6 +354,10 @@ XID GetHighestAncestorWindow(XID window, XID root) { } } +bool GetWindowDesktop(XID window, int* desktop) { + return GetIntProperty(window, "_NET_WM_DESKTOP", desktop); +} + // Returns true if |window| is a named window. bool IsWindowNamed(XID window) { XTextProperty prop; @@ -787,7 +803,12 @@ void GrabWindowSnapshot(GtkWindow* gtk_window, bool ChangeWindowDesktop(XID window, XID destination) { int desktop; - if (!GetIntProperty(destination, "_NET_WM_DESKTOP", &desktop)) + if (!GetWindowDesktop(destination, &desktop)) + return false; + + // If |window| is sticky, use the current desktop. + if (desktop == kAllDesktops && + !GetCurrentDesktop(&desktop)) return false; XEvent event; |