[patch] XInput portability




This changes things so that the XInput header files aren't
included unless GTK is configured for xinput. (And a bit of
cleanup). 

diff -c -r -P -X patch-exclude gtk+970916.orig/gdk/gdkinput.c gtk+970916/gdk/gdkinput.c
*** gtk+970916.orig/gdk/gdkinput.c	Mon Sep 15 18:13:08 1997
--- gtk+970916/gdk/gdkinput.c	Wed Sep 24 18:21:40 1997
***************
*** 276,282 ****
--- 276,284 ----
  	  gdk_input_set_mode(gdkdev->info.deviceid,GDK_MODE_DISABLED);
  
  	  g_free(gdkdev->info.name);
+ #ifndef XINPUT_NONE	  
  	  g_free(gdkdev->axes);
+ #endif	  
  	  g_free(gdkdev->info.axes);
  	  g_free(gdkdev);
  	}
diff -c -r -P -X patch-exclude gtk+970916.orig/gdk/gdkinput.h gtk+970916/gdk/gdkinput.h
*** gtk+970916.orig/gdk/gdkinput.h	Fri Aug 29 18:02:05 1997
--- gtk+970916/gdk/gdkinput.h	Wed Sep 24 18:21:16 1997
***************
*** 19,27 ****
  #ifndef __GDK_INPUT_H__
  #define __GDK_INPUT_H__
  
! /* FIXME this will _break_ */
! 
  #include <X11/extensions/XInput.h>
  
  typedef struct _GdkAxisInfo    GdkAxisInfo;
  typedef struct _GdkInputVTable GdkInputVTable;
--- 19,27 ----
  #ifndef __GDK_INPUT_H__
  #define __GDK_INPUT_H__
  
! #ifndef XINPUT_NONE
  #include <X11/extensions/XInput.h>
+ #endif
  
  typedef struct _GdkAxisInfo    GdkAxisInfo;
  typedef struct _GdkInputVTable GdkInputVTable;
***************
*** 83,88 ****
--- 83,89 ----
  struct _GdkDevicePrivate {
    GdkDeviceInfo  info;
  
+ #ifndef XINPUT_NONE
    /* information about the axes */
    GdkAxisInfo *axes;
  
***************
*** 104,109 ****
--- 105,111 ----
  
    /* true if we've claimed the device as active. (used only for XINPUT_GXI) */
    gint claimed;
+ #endif /* !XINPUT_NONE */
  };
  
  struct _GdkInputWindow
diff -c -r -P -X patch-exclude gtk+970916.orig/gdk/gdkinputxfree.h gtk+970916/gdk/gdkinputxfree.h
*** gtk+970916.orig/gdk/gdkinputxfree.h	Mon Sep 15 18:13:08 1997
--- gtk+970916/gdk/gdkinputxfree.h	Wed Sep 24 18:25:52 1997
***************
*** 288,293 ****
--- 288,294 ----
    gint num_classes;
  
    tmp_list = gdk_input_windows;
+   new_window = NULL;
    while (tmp_list)
      {
        input_window = (GdkInputWindow *)tmp_list->data;
***************
*** 295,305 ****
  	return AlreadyGrabbed;
  
        if (input_window->window == window)
! 	new_window = input_window;
        
        tmp_list = tmp_list->next;
      }
! 
    new_window->grabbed = TRUE;
  
    tmp_list = gdk_input_devices;
--- 296,311 ----
  	return AlreadyGrabbed;
  
        if (input_window->window == window)
! 	{
! 	  new_window = input_window;
! 	  break;
! 	}
        
        tmp_list = tmp_list->next;
      }
!   
!   g_return_if_fail (new_window == NULL);
!   
    new_window->grabbed = TRUE;
  
    tmp_list = gdk_input_devices;




[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]