| Index: views/widget/native_widget_gtk.cc
|
| ===================================================================
|
| --- views/widget/native_widget_gtk.cc (revision 86938)
|
| +++ views/widget/native_widget_gtk.cc (working copy)
|
| @@ -284,7 +284,6 @@
|
|
|
| NativeWidgetGtk::NativeWidgetGtk(internal::NativeWidgetDelegate* delegate)
|
| : is_window_(false),
|
| - window_state_(GDK_WINDOW_STATE_WITHDRAWN),
|
| delegate_(delegate),
|
| widget_(NULL),
|
| window_contents_(NULL),
|
| @@ -717,8 +716,6 @@
|
| G_CALLBACK(&OnDragEndThunk), this);
|
| g_signal_connect(window_contents_, "drag_failed",
|
| G_CALLBACK(&OnDragFailedThunk), this);
|
| - g_signal_connect(G_OBJECT(GetNativeWindow()), "window-state-event",
|
| - G_CALLBACK(&OnWindowStateEventThunk), this);
|
|
|
| tooltip_manager_.reset(new TooltipManagerGtk(this));
|
|
|
| @@ -960,23 +957,15 @@
|
| }
|
| }
|
|
|
| -bool NativeWidgetGtk::IsVisible() const {
|
| - return GTK_WIDGET_VISIBLE(GetNativeView());
|
| +void NativeWidgetGtk::SetOpacity(unsigned char opacity) {
|
| + opacity_ = opacity;
|
| + if (widget_) {
|
| + // We can only set the opacity when the widget has been realized.
|
| + gdk_window_set_opacity(widget_->window, static_cast<gdouble>(opacity) /
|
| + static_cast<gdouble>(255));
|
| + }
|
| }
|
|
|
| -void NativeWidgetGtk::Activate() {
|
| - gtk_window_present(GetNativeWindow());
|
| -}
|
| -
|
| -void NativeWidgetGtk::Deactivate() {
|
| - gdk_window_lower(GTK_WIDGET(GetNativeView())->window);
|
| -}
|
| -
|
| -bool NativeWidgetGtk::IsActive() const {
|
| - DCHECK(!child_);
|
| - return is_active_;
|
| -}
|
| -
|
| void NativeWidgetGtk::SetAlwaysOnTop(bool on_top) {
|
| DCHECK(!child_);
|
| always_on_top_ = on_top;
|
| @@ -984,38 +973,15 @@
|
| gtk_window_set_keep_above(GTK_WINDOW(widget_), on_top);
|
| }
|
|
|
| -void NativeWidgetGtk::Maximize() {
|
| - gtk_window_maximize(GetNativeWindow());
|
| +bool NativeWidgetGtk::IsVisible() const {
|
| + return GTK_WIDGET_VISIBLE(widget_);
|
| }
|
|
|
| -void NativeWidgetGtk::Minimize() {
|
| - gtk_window_iconify(GetNativeWindow());
|
| +bool NativeWidgetGtk::IsActive() const {
|
| + DCHECK(!child_);
|
| + return is_active_;
|
| }
|
|
|
| -bool NativeWidgetGtk::IsMaximized() const {
|
| - return window_state_ & GDK_WINDOW_STATE_MAXIMIZED;
|
| -}
|
| -
|
| -bool NativeWidgetGtk::IsMinimized() const {
|
| - return window_state_ & GDK_WINDOW_STATE_ICONIFIED;
|
| -}
|
| -
|
| -void NativeWidgetGtk::Restore() {
|
| - if (IsMaximized())
|
| - gtk_window_unmaximize(GetNativeWindow());
|
| - else if (IsMinimized())
|
| - gtk_window_deiconify(GetNativeWindow());
|
| -}
|
| -
|
| -void NativeWidgetGtk::SetOpacity(unsigned char opacity) {
|
| - opacity_ = opacity;
|
| - if (widget_) {
|
| - // We can only set the opacity when the widget has been realized.
|
| - gdk_window_set_opacity(widget_->window, static_cast<gdouble>(opacity) /
|
| - static_cast<gdouble>(255));
|
| - }
|
| -}
|
| -
|
| bool NativeWidgetGtk::IsAccessibleWidget() const {
|
| return false;
|
| }
|
| @@ -1395,12 +1361,6 @@
|
| void NativeWidgetGtk::OnHide(GtkWidget* widget) {
|
| }
|
|
|
| -gboolean NativeWidgetGtk::OnWindowStateEvent(GtkWidget* widget,
|
| - GdkEventWindowState* event) {
|
| - window_state_ = event->new_window_state;
|
| - return FALSE;
|
| -}
|
| -
|
| void NativeWidgetGtk::HandleXGrabBroke() {
|
| }
|
|
|
|
|