[gtk+/wip/carlosg/event-delivery: 53/66] gtkmain: Use window-internal API to update pointer cursors
- From: Carlos Garnacho <carlosg src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtk+/wip/carlosg/event-delivery: 53/66] gtkmain: Use window-internal API to update pointer cursors
- Date: Mon, 10 Apr 2017 15:30:22 +0000 (UTC)
commit b8023c9236240ccfb02103c22ff7c6ed989dfc24
Author: Carlos Garnacho <carlosg gnome org>
Date: Tue Apr 4 17:09:22 2017 +0200
gtkmain: Use window-internal API to update pointer cursors
gtk/gtkmain.c | 19 +------------------
1 files changed, 1 insertions(+), 18 deletions(-)
---
diff --git a/gtk/gtkmain.c b/gtk/gtkmain.c
index a52f013..38d208d 100644
--- a/gtk/gtkmain.c
+++ b/gtk/gtkmain.c
@@ -1307,23 +1307,6 @@ check_event_in_child_popover (GtkWidget *event_widget,
return (popover_parent == grab_widget || gtk_widget_is_ancestor (popover_parent, grab_widget));
}
-static void
-update_cursor (GtkWindow *toplevel,
- GdkDevice *device,
- GtkWidget *target)
-{
- GdkCursor *cursor = NULL;
-
- while (!cursor && target)
- {
- cursor = gtk_widget_get_cursor (target);
- target = _gtk_widget_get_parent (target);
- }
-
- gdk_window_set_device_cursor (gtk_widget_get_window (GTK_WIDGET (toplevel)),
- device, cursor);
-}
-
static GdkNotifyType
get_virtual_notify_type (GdkNotifyType notify_type)
{
@@ -1502,7 +1485,7 @@ handle_pointing_event (GdkEvent *event)
target = _gtk_toplevel_pick (toplevel, x, y, NULL, NULL);
old_target = update_pointer_focus_state (toplevel, event, target);
if (event->type == GDK_MOTION_NOTIFY || event->type == GDK_ENTER_NOTIFY)
- update_cursor (toplevel, device, target);
+ gtk_window_maybe_update_cursor (toplevel, target, device);
if (event->type == GDK_TOUCH_BEGIN)
gtk_window_set_pointer_focus_grab (toplevel, device, sequence, target);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]