| OLD | NEW |
| 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 1332 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1343 GtkAllocation* allocation) { | 1343 GtkAllocation* allocation) { |
| 1344 // See comment next to size_ as to why we do this. Also note, it's tempting | 1344 // See comment next to size_ as to why we do this. Also note, it's tempting |
| 1345 // to put this in the static method so subclasses don't need to worry about | 1345 // to put this in the static method so subclasses don't need to worry about |
| 1346 // it, but if a subclasses needs to set a shape then they need to always | 1346 // it, but if a subclasses needs to set a shape then they need to always |
| 1347 // reset the shape in this method regardless of whether the size changed. | 1347 // reset the shape in this method regardless of whether the size changed. |
| 1348 gfx::Size new_size(allocation->width, allocation->height); | 1348 gfx::Size new_size(allocation->width, allocation->height); |
| 1349 if (new_size == size_) | 1349 if (new_size == size_) |
| 1350 return; | 1350 return; |
| 1351 size_ = new_size; | 1351 size_ = new_size; |
| 1352 if (compositor_.get()) | 1352 if (compositor_.get()) |
| 1353 compositor_->OnWidgetSizeChanged(size_); | 1353 compositor_->WidgetSizeChanged(size_); |
| 1354 delegate_->OnNativeWidgetSizeChanged(size_); | 1354 delegate_->OnNativeWidgetSizeChanged(size_); |
| 1355 | 1355 |
| 1356 if (GetWidget()->non_client_view()) { | 1356 if (GetWidget()->non_client_view()) { |
| 1357 // The Window's NonClientView may provide a custom shape for the Window. | 1357 // The Window's NonClientView may provide a custom shape for the Window. |
| 1358 gfx::Path window_mask; | 1358 gfx::Path window_mask; |
| 1359 GetWidget()->non_client_view()->GetWindowMask(gfx::Size(allocation->width, | 1359 GetWidget()->non_client_view()->GetWindowMask(gfx::Size(allocation->width, |
| 1360 allocation->height), | 1360 allocation->height), |
| 1361 &window_mask); | 1361 &window_mask); |
| 1362 GdkRegion* mask_region = window_mask.CreateNativeRegion(); | 1362 GdkRegion* mask_region = window_mask.CreateNativeRegion(); |
| 1363 gdk_window_shape_combine_region(GetNativeView()->window, mask_region, 0, 0); | 1363 gdk_window_shape_combine_region(GetNativeView()->window, mask_region, 0, 0); |
| (...skipping 879 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2243 button_pressed = event->type == GDK_BUTTON_PRESS || | 2243 button_pressed = event->type == GDK_BUTTON_PRESS || |
| 2244 event->type == GDK_2BUTTON_PRESS || | 2244 event->type == GDK_2BUTTON_PRESS || |
| 2245 event->type == GDK_3BUTTON_PRESS; | 2245 event->type == GDK_3BUTTON_PRESS; |
| 2246 gdk_event_free(event); | 2246 gdk_event_free(event); |
| 2247 } | 2247 } |
| 2248 return button_pressed; | 2248 return button_pressed; |
| 2249 } | 2249 } |
| 2250 | 2250 |
| 2251 } // namespace internal | 2251 } // namespace internal |
| 2252 } // namespace views | 2252 } // namespace views |
| OLD | NEW |