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 1313 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1324 // 3) If it's never painted before. The first expose event will | 1324 // 3) If it's never painted before. The first expose event will |
1325 // paint the area that has to be painted. | 1325 // paint the area that has to be painted. |
1326 if (widget_ && GTK_WIDGET_DRAWABLE(widget_) && painted_) { | 1326 if (widget_ && GTK_WIDGET_DRAWABLE(widget_) && painted_) { |
1327 gtk_widget_queue_draw_area(widget_, rect.x(), rect.y(), rect.width(), | 1327 gtk_widget_queue_draw_area(widget_, rect.x(), rect.y(), rect.width(), |
1328 rect.height()); | 1328 rect.height()); |
1329 } | 1329 } |
1330 } | 1330 } |
1331 | 1331 |
1332 void NativeWidgetGtk::SetCursor(gfx::NativeCursor cursor) { | 1332 void NativeWidgetGtk::SetCursor(gfx::NativeCursor cursor) { |
1333 #if defined(TOUCH_UI) | 1333 #if defined(TOUCH_UI) |
1334 if (ui::TouchFactory::GetInstance()->keep_mouse_cursor()) | 1334 if (!ui::TouchFactory::GetInstance()->is_cursor_visible()) |
1335 cursor = gfx::GetCursor(GDK_ARROW); | |
1336 else if (!ui::TouchFactory::GetInstance()->is_cursor_visible()) | |
1337 cursor = gfx::GetCursor(GDK_BLANK_CURSOR); | 1335 cursor = gfx::GetCursor(GDK_BLANK_CURSOR); |
1338 #endif | 1336 #endif |
1339 // |window_contents_| is placed on top of |widget_|. So the cursor needs to be | 1337 // |window_contents_| is placed on top of |widget_|. So the cursor needs to be |
1340 // set on |window_contents_| instead of |widget_|. | 1338 // set on |window_contents_| instead of |widget_|. |
1341 if (window_contents_) | 1339 if (window_contents_) |
1342 gdk_window_set_cursor(window_contents_->window, cursor); | 1340 gdk_window_set_cursor(window_contents_->window, cursor); |
1343 } | 1341 } |
1344 | 1342 |
1345 void NativeWidgetGtk::ClearNativeFocus() { | 1343 void NativeWidgetGtk::ClearNativeFocus() { |
1346 DCHECK(!child_); | 1344 DCHECK(!child_); |
(...skipping 959 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2306 button_pressed = event->type == GDK_BUTTON_PRESS || | 2304 button_pressed = event->type == GDK_BUTTON_PRESS || |
2307 event->type == GDK_2BUTTON_PRESS || | 2305 event->type == GDK_2BUTTON_PRESS || |
2308 event->type == GDK_3BUTTON_PRESS; | 2306 event->type == GDK_3BUTTON_PRESS; |
2309 gdk_event_free(event); | 2307 gdk_event_free(event); |
2310 } | 2308 } |
2311 return button_pressed; | 2309 return button_pressed; |
2312 } | 2310 } |
2313 | 2311 |
2314 } // namespace internal | 2312 } // namespace internal |
2315 } // namespace views | 2313 } // namespace views |
OLD | NEW |