[gimp/gtk3-port: 43/228] app: use GdkDeviceManager to list devices
- From: Michael Natterer <mitch src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gimp/gtk3-port: 43/228] app: use GdkDeviceManager to list devices
- Date: Fri, 4 May 2012 15:25:28 +0000 (UTC)
commit 9e2e547f4d361bbfec8815a5e8e643d75a0b4d4c
Author: Michael Natterer <mitch gimp org>
Date: Tue Oct 19 13:55:42 2010 +0200
app: use GdkDeviceManager to list devices
app/widgets/gimptoolbox.c | 20 ++++++++++++++------
1 files changed, 14 insertions(+), 6 deletions(-)
---
diff --git a/app/widgets/gimptoolbox.c b/app/widgets/gimptoolbox.c
index f5debbc..affc366 100644
--- a/app/widgets/gimptoolbox.c
+++ b/app/widgets/gimptoolbox.c
@@ -199,11 +199,13 @@ gimp_toolbox_init (GimpToolbox *toolbox)
static void
gimp_toolbox_constructed (GObject *object)
{
- GimpToolbox *toolbox = GIMP_TOOLBOX (object);
- GimpGuiConfig *config;
- GtkWidget *main_vbox;
- GdkDisplay *display;
- GList *list;
+ GimpToolbox *toolbox = GIMP_TOOLBOX (object);
+ GimpGuiConfig *config;
+ GtkWidget *main_vbox;
+ GdkDisplay *display;
+ GdkDeviceManager *manager;
+ GList *devices;
+ GList *list;
g_assert (GIMP_IS_CONTEXT (toolbox->p->context));
@@ -286,10 +288,16 @@ gimp_toolbox_constructed (GObject *object)
* manually that all devices have a cursor, before establishing the check.
*/
display = gtk_widget_get_display (GTK_WIDGET (toolbox));
- for (list = gdk_display_list_devices (display); list; list = list->next)
+ manager = gdk_display_get_device_manager (display);
+
+ devices = gdk_device_manager_list_devices (manager, GDK_DEVICE_TYPE_MASTER);
+
+ for (list = devices; list; list = g_list_next (list))
if (! ((GdkDevice *) (list->data))->has_cursor)
break;
+ g_list_free (devices);
+
if (! list) /* all devices have cursor */
{
gtk_widget_add_events (GTK_WIDGET (toolbox), GDK_POINTER_MOTION_MASK);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]