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

Side by Side Diff: chrome/browser/ui/gtk/apps/native_app_window_gtk.cc

Issue 50073003: Fix crash on Linux when a normal window is created after a hidden window. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: with review comments Created 7 years, 1 month 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 | « chrome/browser/apps/app_crash_browsertest.cc ('k') | chrome/chrome_tests.gypi » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 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 "chrome/browser/ui/gtk/apps/native_app_window_gtk.h" 5 #include "chrome/browser/ui/gtk/apps/native_app_window_gtk.h"
6 6
7 #include <gdk/gdkx.h> 7 #include <gdk/gdkx.h>
8 #include <vector> 8 #include <vector>
9 9
10 #include "base/message_loop/message_pump_gtk.h" 10 #include "base/message_loop/message_pump_gtk.h"
(...skipping 294 matching lines...) Expand 10 before | Expand all | Expand 10 after
305 GdkEvent* gdk_event) { 305 GdkEvent* gdk_event) {
306 // Work around GTK+ not reporting minimization state changes. Listen 306 // Work around GTK+ not reporting minimization state changes. Listen
307 // for _NET_WM_STATE property changes and use _NET_WM_STATE_HIDDEN's 307 // for _NET_WM_STATE property changes and use _NET_WM_STATE_HIDDEN's
308 // presence to set or clear the iconified bit if _NET_WM_STATE_HIDDEN 308 // presence to set or clear the iconified bit if _NET_WM_STATE_HIDDEN
309 // is supported. http://crbug.com/162794. 309 // is supported. http://crbug.com/162794.
310 XEvent* x_event = static_cast<XEvent*>(gdk_x_event); 310 XEvent* x_event = static_cast<XEvent*>(gdk_x_event);
311 std::vector< ::Atom> atom_list; 311 std::vector< ::Atom> atom_list;
312 312
313 if (x_event->type == PropertyNotify && 313 if (x_event->type == PropertyNotify &&
314 x_event->xproperty.atom == atom_cache_.GetAtom("_NET_WM_STATE") && 314 x_event->xproperty.atom == atom_cache_.GetAtom("_NET_WM_STATE") &&
315 GTK_WIDGET(window_)->window &&
315 ui::GetAtomArrayProperty(GDK_WINDOW_XWINDOW(GTK_WIDGET(window_)->window), 316 ui::GetAtomArrayProperty(GDK_WINDOW_XWINDOW(GTK_WIDGET(window_)->window),
316 "_NET_WM_STATE", 317 "_NET_WM_STATE",
317 &atom_list)) { 318 &atom_list)) {
318 std::vector< ::Atom>::iterator it = 319 std::vector< ::Atom>::iterator it =
319 std::find(atom_list.begin(), 320 std::find(atom_list.begin(),
320 atom_list.end(), 321 atom_list.end(),
321 atom_cache_.GetAtom("_NET_WM_STATE_HIDDEN")); 322 atom_cache_.GetAtom("_NET_WM_STATE_HIDDEN"));
322 state_ = (it != atom_list.end()) ? GDK_WINDOW_STATE_ICONIFIED : 323 state_ = (it != atom_list.end()) ? GDK_WINDOW_STATE_ICONIFIED :
323 static_cast<GdkWindowState>(state_ & ~GDK_WINDOW_STATE_ICONIFIED); 324 static_cast<GdkWindowState>(state_ & ~GDK_WINDOW_STATE_ICONIFIED);
324 325
(...skipping 378 matching lines...) Expand 10 before | Expand all | Expand 10 after
703 hints_mask |= GDK_HINT_MAX_SIZE; 704 hints_mask |= GDK_HINT_MAX_SIZE;
704 } 705 }
705 if (hints_mask) { 706 if (hints_mask) {
706 gtk_window_set_geometry_hints( 707 gtk_window_set_geometry_hints(
707 window_, 708 window_,
708 GTK_WIDGET(window_), 709 GTK_WIDGET(window_),
709 &hints, 710 &hints,
710 static_cast<GdkWindowHints>(hints_mask)); 711 static_cast<GdkWindowHints>(hints_mask));
711 } 712 }
712 } 713 }
OLDNEW
« no previous file with comments | « chrome/browser/apps/app_crash_browsertest.cc ('k') | chrome/chrome_tests.gypi » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698