OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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/browser_titlebar.h" | 5 #include "chrome/browser/ui/gtk/browser_titlebar.h" |
6 | 6 |
7 #include <gdk/gdkkeysyms.h> | 7 #include <gdk/gdkkeysyms.h> |
8 #include <gtk/gtk.h> | 8 #include <gtk/gtk.h> |
9 | 9 |
10 #include <string> | 10 #include <string> |
(...skipping 834 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
845 } else { | 845 } else { |
846 GtkWidget* widget = GTK_WIDGET(window_); | 846 GtkWidget* widget = GTK_WIDGET(window_); |
847 GdkScreen* screen = gtk_widget_get_screen(widget); | 847 GdkScreen* screen = gtk_widget_get_screen(widget); |
848 gint monitor = gdk_screen_get_monitor_at_window( | 848 gint monitor = gdk_screen_get_monitor_at_window( |
849 screen, gtk_widget_get_window(widget)); | 849 screen, gtk_widget_get_window(widget)); |
850 GdkRectangle screen_rect; | 850 GdkRectangle screen_rect; |
851 gdk_screen_get_monitor_geometry(screen, monitor, &screen_rect); | 851 gdk_screen_get_monitor_geometry(screen, monitor, &screen_rect); |
852 | 852 |
853 gint x, y; | 853 gint x, y; |
854 gtk_window_get_position(window_, &x, &y); | 854 gtk_window_get_position(window_, &x, &y); |
855 gint width = widget->allocation.width; | 855 |
856 gint height = widget->allocation.height; | 856 GtkAllocation allocation; |
| 857 gtk_widget_get_allocation(widget, &allocation); |
| 858 gint width = allocation.width; |
| 859 gint height = allocation.height; |
857 | 860 |
858 if (event->button.button == 3) { | 861 if (event->button.button == 3) { |
859 x = 0; | 862 x = 0; |
860 width = screen_rect.width; | 863 width = screen_rect.width; |
861 } else if (event->button.button == 2) { | 864 } else if (event->button.button == 2) { |
862 y = 0; | 865 y = 0; |
863 height = screen_rect.height; | 866 height = screen_rect.height; |
864 } | 867 } |
865 | 868 |
866 browser_window_->SetBounds(gfx::Rect(x, y, width, height)); | 869 browser_window_->SetBounds(gfx::Rect(x, y, width, height)); |
(...skipping 270 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1137 ui::SimpleMenuModel::Delegate* delegate) | 1140 ui::SimpleMenuModel::Delegate* delegate) |
1138 : SimpleMenuModel(delegate) { | 1141 : SimpleMenuModel(delegate) { |
1139 AddItemWithStringId(IDC_NEW_TAB, IDS_TAB_CXMENU_NEWTAB); | 1142 AddItemWithStringId(IDC_NEW_TAB, IDS_TAB_CXMENU_NEWTAB); |
1140 AddItemWithStringId(IDC_RESTORE_TAB, IDS_RESTORE_TAB); | 1143 AddItemWithStringId(IDC_RESTORE_TAB, IDS_RESTORE_TAB); |
1141 AddSeparator(); | 1144 AddSeparator(); |
1142 AddItemWithStringId(IDC_TASK_MANAGER, IDS_TASK_MANAGER); | 1145 AddItemWithStringId(IDC_TASK_MANAGER, IDS_TASK_MANAGER); |
1143 AddSeparator(); | 1146 AddSeparator(); |
1144 AddCheckItemWithStringId(kShowWindowDecorationsCommand, | 1147 AddCheckItemWithStringId(kShowWindowDecorationsCommand, |
1145 IDS_SHOW_WINDOW_DECORATIONS_MENU); | 1148 IDS_SHOW_WINDOW_DECORATIONS_MENU); |
1146 } | 1149 } |
OLD | NEW |