OLD | NEW |
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 Loading... |
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 Loading... |
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 } |
OLD | NEW |