[gimp/gtk3-port: 69/130] app: use GdkDeviceManager to list devices
- From: Michael Natterer <mitch src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gimp/gtk3-port: 69/130] app: use GdkDeviceManager to list devices
- Date: Sun, 14 Nov 2010 22:09:01 +0000 (UTC)
commit 685590802ea6df1ca7560304fab39a16ca7d1455
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 | 22 +++++++++++++++-------
1 files changed, 15 insertions(+), 7 deletions(-)
---
diff --git a/app/widgets/gimptoolbox.c b/app/widgets/gimptoolbox.c
index 6565340..1b24c44 100644
--- a/app/widgets/gimptoolbox.c
+++ b/app/widgets/gimptoolbox.c
@@ -260,12 +260,14 @@ gimp_toolbox_constructor (GType type,
guint n_params,
GObjectConstructParam *params)
{
- GObject *object;
- GimpToolbox *toolbox;
- GimpGuiConfig *config;
- GtkWidget *main_vbox;
- GdkDisplay *display;
- GList *list;
+ GObject *object;
+ GimpToolbox *toolbox;
+ GimpGuiConfig *config;
+ GtkWidget *main_vbox;
+ GdkDisplay *display;
+ GdkDeviceManager *manager;
+ GList *devices;
+ GList *list;
object = G_OBJECT_CLASS (parent_class)->constructor (type, n_params, params);
@@ -345,10 +347,16 @@ gimp_toolbox_constructor (GType type,
* 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 */
{
g_signal_connect (toolbox, "motion-notify-event",
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]