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

Side by Side Diff: chrome/browser/gtk/browser_window_gtk.cc

Issue 159316: linux: obey window positioning information when bounds are overridden (Closed)
Patch Set: seems to work Created 11 years, 5 months 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/browser.h ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 1052 matching lines...) Expand 10 before | Expand all | Expand 10 after
1063 geometry.min_width = 1; 1063 geometry.min_width = 1;
1064 geometry.min_height = 1; 1064 geometry.min_height = 1;
1065 gtk_window_set_geometry_hints(window_, NULL, &geometry, GDK_HINT_MIN_SIZE); 1065 gtk_window_set_geometry_hints(window_, NULL, &geometry, GDK_HINT_MIN_SIZE);
1066 1066
1067 if (browser_->GetSavedMaximizedState()) 1067 if (browser_->GetSavedMaximizedState())
1068 gtk_window_maximize(window_); 1068 gtk_window_maximize(window_);
1069 else 1069 else
1070 gtk_window_unmaximize(window_); 1070 gtk_window_unmaximize(window_);
1071 1071
1072 gfx::Rect bounds = browser_->GetSavedWindowBounds(); 1072 gfx::Rect bounds = browser_->GetSavedWindowBounds();
1073 // Note that calling SetBounds() here is incorrect, as that sets a forced 1073 // We don't blindly call SetBounds here, that sets a forced position
1074 // position on the window and we intentionally *don't* do that. We tested 1074 // on the window and we intentionally *don't* do that for normal
1075 // many programs and none of them restored their position on Linux. 1075 // windows. We tested many programs and none of them restored their
1076 gtk_window_resize(window_, bounds.width(), bounds.height()); 1076 // position on Linux.
1077 //
1078 // However, in cases like dropping a tab where the bounds are
1079 // specifically set, we do want to position explicitly.
1080 if (browser_->bounds_overridden()) {
1081 SetBounds(bounds);
1082 } else {
1083 // Ignore the position but obey the size.
1084 gtk_window_resize(window_, bounds.width(), bounds.height());
1085 }
1077 } 1086 }
1078 1087
1079 void BrowserWindowGtk::ConnectHandlersToSignals() { 1088 void BrowserWindowGtk::ConnectHandlersToSignals() {
1080 g_signal_connect(window_, "delete-event", 1089 g_signal_connect(window_, "delete-event",
1081 G_CALLBACK(MainWindowDeleteEvent), this); 1090 G_CALLBACK(MainWindowDeleteEvent), this);
1082 g_signal_connect(window_, "destroy", 1091 g_signal_connect(window_, "destroy",
1083 G_CALLBACK(MainWindowDestroy), this); 1092 G_CALLBACK(MainWindowDestroy), this);
1084 g_signal_connect(window_, "configure-event", 1093 g_signal_connect(window_, "configure-event",
1085 G_CALLBACK(MainWindowConfigured), this); 1094 G_CALLBACK(MainWindowConfigured), this);
1086 g_signal_connect(window_, "window-state-event", 1095 g_signal_connect(window_, "window-state-event",
(...skipping 472 matching lines...) Expand 10 before | Expand all | Expand 10 after
1559 *edge = GDK_WINDOW_EDGE_NORTH_EAST; 1568 *edge = GDK_WINDOW_EDGE_NORTH_EAST;
1560 } else if (y < bounds_.height() - kResizeAreaCornerSize) { 1569 } else if (y < bounds_.height() - kResizeAreaCornerSize) {
1561 *edge = GDK_WINDOW_EDGE_EAST; 1570 *edge = GDK_WINDOW_EDGE_EAST;
1562 } else { 1571 } else {
1563 *edge = GDK_WINDOW_EDGE_SOUTH_EAST; 1572 *edge = GDK_WINDOW_EDGE_SOUTH_EAST;
1564 } 1573 }
1565 return true; 1574 return true;
1566 } 1575 }
1567 NOTREACHED(); 1576 NOTREACHED();
1568 } 1577 }
OLDNEW
« no previous file with comments | « chrome/browser/browser.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698