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

Unified Diff: views/widget/widget_gtk.cc

Issue 125087: Make WidgetGtk::SetBounds use a single call if it can. (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 11 years, 6 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: views/widget/widget_gtk.cc
===================================================================
--- views/widget/widget_gtk.cc (revision 18216)
+++ views/widget/widget_gtk.cc (working copy)
@@ -262,6 +262,11 @@
WidgetGtk* parent_widget = GetViewForNative(gtk_widget_get_parent(widget_));
parent_widget->PositionChild(widget_, bounds.x(), bounds.y(),
bounds.width(), bounds.height());
+ } else if (GTK_WIDGET_MAPPED(widget_)) {
+ // If the widget is mapped (on screen), we can move and resize with one
+ // call, which avoids two separate window manager steps.
+ gdk_window_move_resize(widget_->window, bounds.x(), bounds.y(),
+ bounds.width(), bounds.height());
} else {
GtkWindow* gtk_window = GTK_WINDOW(widget_);
// TODO: this may need to set an initial size if not showing.
Property changes on: views/widget/widget_gtk.cc
___________________________________________________________________
Name: svn:eol-style
+ LF
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698