return NULL if device is not ready gtk/gtkwindow.h: check for

Fri Mar  6 14:47:33 PST 1998 Shawn T. Amundson <amundson@gimp.org>

        * Applied gtk-matsu-980205-0 (oops, should be 980305)
          gdk/gdkinputcommon.h: return NULL if device is not ready
          gtk/gtkwindow.h: check for GDK_ISO_Left_Tab
This commit is contained in:
PST 1998 Shawn T. Amundson
1998-03-06 23:17:12 +00:00
committed by Shawn Amundson
parent 2095c552f8
commit 16f8b9f627
10 changed files with 88 additions and 0 deletions

View File

@ -257,7 +257,29 @@ gdk_input_device_new(XDeviceInfo *device, gint include_core)
}
if (device->use != IsXPointer)
{
int error_warn = gdk_error_warnings;
gdk_error_warnings = 0;
gdk_error_code = 0;
gdkdev->xdevice = XOpenDevice(gdk_display, gdkdev->info.deviceid);
gdk_error_warnings = error_warn;
/* return NULL if device is not ready */
if (gdk_error_code)
{
g_free (gdkdev->info.name);
if (gdkdev->axes)
g_free (gdkdev->axes);
if (gdkdev->info.keys)
g_free (gdkdev->info.keys);
if (gdkdev->info.axes)
g_free (gdkdev->info.axes);
g_free (gdkdev);
return NULL;
}
}
gdkdev->buttonpress_type = 0;
gdkdev->buttonrelease_type = 0;