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

Side by Side Diff: views/widget/native_widget_gtk.cc

Issue 7358005: Makes sure widget is created at right size before showing (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 9 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 | Annotate | Revision Log
OLDNEW
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 "views/widget/native_widget_gtk.h" 5 #include "views/widget/native_widget_gtk.h"
6 6
7 #include <gdk/gdk.h> 7 #include <gdk/gdk.h>
8 #include <gdk/gdkx.h> 8 #include <gdk/gdkx.h>
9 #include <X11/extensions/shape.h> 9 #include <X11/extensions/shape.h>
10 #include <X11/Xatom.h> 10 #include <X11/Xatom.h>
(...skipping 1136 matching lines...) Expand 10 before | Expand all | Expand 10 after
1147 } 1147 }
1148 1148
1149 void NativeWidgetGtk::Hide() { 1149 void NativeWidgetGtk::Hide() {
1150 if (widget_) { 1150 if (widget_) {
1151 gtk_widget_hide(widget_); 1151 gtk_widget_hide(widget_);
1152 if (widget_->window) 1152 if (widget_->window)
1153 gdk_window_lower(widget_->window); 1153 gdk_window_lower(widget_->window);
1154 } 1154 }
1155 } 1155 }
1156 1156
1157 void NativeWidgetGtk::ShowMaximized(const gfx::Rect& restored_bounds) {
1158 // TODO: when we add maximization support update this.
1159 Show();
1160 }
1161
1157 void NativeWidgetGtk::ShowNativeWidget(ShowState state) { 1162 void NativeWidgetGtk::ShowNativeWidget(ShowState state) {
1158 // No concept of maximization (yet) on ChromeOS. 1163 // No concept of maximization (yet) on ChromeOS.
1159 if (state == internal::NativeWidgetPrivate::SHOW_INACTIVE) 1164 if (state == internal::NativeWidgetPrivate::SHOW_INACTIVE)
1160 gtk_window_set_focus_on_map(GetNativeWindow(), false); 1165 gtk_window_set_focus_on_map(GetNativeWindow(), false);
1161 gtk_widget_show(GetNativeView()); 1166 gtk_widget_show(GetNativeView());
1162 } 1167 }
1163 1168
1164 bool NativeWidgetGtk::IsVisible() const { 1169 bool NativeWidgetGtk::IsVisible() const {
1165 return GTK_WIDGET_VISIBLE(GetNativeView()); 1170 return GTK_WIDGET_VISIBLE(GetNativeView());
1166 } 1171 }
(...skipping 994 matching lines...) Expand 10 before | Expand all | Expand 10 after
2161 button_pressed = event->type == GDK_BUTTON_PRESS || 2166 button_pressed = event->type == GDK_BUTTON_PRESS ||
2162 event->type == GDK_2BUTTON_PRESS || 2167 event->type == GDK_2BUTTON_PRESS ||
2163 event->type == GDK_3BUTTON_PRESS; 2168 event->type == GDK_3BUTTON_PRESS;
2164 gdk_event_free(event); 2169 gdk_event_free(event);
2165 } 2170 }
2166 return button_pressed; 2171 return button_pressed;
2167 } 2172 }
2168 2173
2169 } // namespace internal 2174 } // namespace internal
2170 } // namespace views 2175 } // namespace views
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698