OLD | NEW |
1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2009 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/gtk/browser_window_gtk.h" | 5 #include "chrome/browser/gtk/browser_window_gtk.h" |
6 | 6 |
7 #include <gdk/gdkkeysyms.h> | 7 #include <gdk/gdkkeysyms.h> |
8 #include <X11/XF86keysym.h> | 8 #include <X11/XF86keysym.h> |
9 | 9 |
10 #include "app/resource_bundle.h" | 10 #include "app/resource_bundle.h" |
(...skipping 373 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
384 #endif | 384 #endif |
385 frame_cursor_(NULL), | 385 frame_cursor_(NULL), |
386 is_active_(true) { | 386 is_active_(true) { |
387 use_custom_frame_.Init(prefs::kUseCustomChromeFrame, | 387 use_custom_frame_.Init(prefs::kUseCustomChromeFrame, |
388 browser_->profile()->GetPrefs(), this); | 388 browser_->profile()->GetPrefs(), this); |
389 window_ = GTK_WINDOW(gtk_window_new(GTK_WINDOW_TOPLEVEL)); | 389 window_ = GTK_WINDOW(gtk_window_new(GTK_WINDOW_TOPLEVEL)); |
390 g_object_set_data(G_OBJECT(window_), kBrowserWindowKey, this); | 390 g_object_set_data(G_OBJECT(window_), kBrowserWindowKey, this); |
391 gtk_widget_add_events(GTK_WIDGET(window_), GDK_BUTTON_PRESS_MASK | | 391 gtk_widget_add_events(GTK_WIDGET(window_), GDK_BUTTON_PRESS_MASK | |
392 GDK_POINTER_MOTION_MASK); | 392 GDK_POINTER_MOTION_MASK); |
393 | 393 |
| 394 // Add this window to its own unique window group to allow for |
| 395 // window-to-parent modality. |
| 396 gtk_window_group_add_window(gtk_window_group_new(), window_); |
| 397 g_object_unref(gtk_window_get_group(window_)); |
| 398 |
394 gtk_util::SetWindowIcon(window_); | 399 gtk_util::SetWindowIcon(window_); |
395 SetBackgroundColor(); | 400 SetBackgroundColor(); |
396 SetGeometryHints(); | 401 SetGeometryHints(); |
397 ConnectHandlersToSignals(); | 402 ConnectHandlersToSignals(); |
398 ConnectAccelerators(); | 403 ConnectAccelerators(); |
399 bounds_ = GetInitialWindowBounds(window_); | 404 bounds_ = GetInitialWindowBounds(window_); |
400 | 405 |
401 InitWidgets(); | 406 InitWidgets(); |
402 HideUnsupportedWindowFeatures(); | 407 HideUnsupportedWindowFeatures(); |
403 | 408 |
(...skipping 1125 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1529 *edge = GDK_WINDOW_EDGE_NORTH_EAST; | 1534 *edge = GDK_WINDOW_EDGE_NORTH_EAST; |
1530 } else if (y < bounds_.height() - kResizeAreaCornerSize) { | 1535 } else if (y < bounds_.height() - kResizeAreaCornerSize) { |
1531 *edge = GDK_WINDOW_EDGE_EAST; | 1536 *edge = GDK_WINDOW_EDGE_EAST; |
1532 } else { | 1537 } else { |
1533 *edge = GDK_WINDOW_EDGE_SOUTH_EAST; | 1538 *edge = GDK_WINDOW_EDGE_SOUTH_EAST; |
1534 } | 1539 } |
1535 return true; | 1540 return true; |
1536 } | 1541 } |
1537 NOTREACHED(); | 1542 NOTREACHED(); |
1538 } | 1543 } |
OLD | NEW |