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 "chrome/browser/ui/gtk/panels/panel_gtk.h" | 5 #include "chrome/browser/ui/gtk/panels/panel_gtk.h" |
6 | 6 |
7 #include <gdk/gdk.h> | 7 #include <gdk/gdk.h> |
8 #include <gdk/gdkkeysyms.h> | 8 #include <gdk/gdkkeysyms.h> |
9 #include <X11/XF86keysym.h> | 9 #include <X11/XF86keysym.h> |
10 | 10 |
(...skipping 805 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
816 panel_->OnNativePanelClosed(); | 816 panel_->OnNativePanelClosed(); |
817 | 817 |
818 // We don't want GlobalMenuBar handling any notifications or commands after | 818 // We don't want GlobalMenuBar handling any notifications or commands after |
819 // the window is destroyed. | 819 // the window is destroyed. |
820 // TODO(jennb): global_menu_bar_->Disable(); | 820 // TODO(jennb): global_menu_bar_->Disable(); |
821 gtk_widget_destroy(window); | 821 gtk_widget_destroy(window); |
822 } | 822 } |
823 | 823 |
824 void PanelGtk::ActivatePanel() { | 824 void PanelGtk::ActivatePanel() { |
825 gtk_window_present(window_); | 825 gtk_window_present(window_); |
| 826 |
| 827 // When the user clicks to expand the minimized panel, the panel has already |
| 828 // become an active window before gtk_window_present is called. Thus the |
| 829 // active window change event, fired by ActiveWindowWatcherXObserver, is not |
| 830 // triggered. We need to call ActiveWindowChanged manually to update panel's |
| 831 // active status. It is OK to call ActiveWindowChanged with the same active |
| 832 // window twice since the 2nd call is just a no-op. |
| 833 ActiveWindowChanged(gtk_widget_get_window(GTK_WIDGET(window_))); |
826 } | 834 } |
827 | 835 |
828 void PanelGtk::DeactivatePanel() { | 836 void PanelGtk::DeactivatePanel() { |
829 gdk_window_lower(gtk_widget_get_window(GTK_WIDGET(window_))); | 837 gdk_window_lower(gtk_widget_get_window(GTK_WIDGET(window_))); |
830 | 838 |
831 // Per ICCCM: http://tronche.com/gui/x/icccm/sec-4.html#s-4.1.7 | 839 // Per ICCCM: http://tronche.com/gui/x/icccm/sec-4.html#s-4.1.7 |
832 // A convention is also required for clients that want to give up the | 840 // A convention is also required for clients that want to give up the |
833 // input focus. There is no safe value set for them to set the input | 841 // input focus. There is no safe value set for them to set the input |
834 // focus to; therefore, they should ignore input material. | 842 // focus to; therefore, they should ignore input material. |
835 // | 843 // |
(...skipping 333 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1169 default: | 1177 default: |
1170 NOTREACHED(); | 1178 NOTREACHED(); |
1171 return false; | 1179 return false; |
1172 } | 1180 } |
1173 return gtk_widget_get_visible(button->widget()); | 1181 return gtk_widget_get_visible(button->widget()); |
1174 } | 1182 } |
1175 | 1183 |
1176 panel::CornerStyle GtkNativePanelTesting::GetWindowCornerStyle() const { | 1184 panel::CornerStyle GtkNativePanelTesting::GetWindowCornerStyle() const { |
1177 return panel_gtk_->corner_style_; | 1185 return panel_gtk_->corner_style_; |
1178 } | 1186 } |
OLD | NEW |