Tk Source Code

Check-in [addedfa6]
Login

Many hyperlinks are disabled.
Use anonymous login to enable hyperlinks.

Overview
Comment:Bug [3599928]: Use XkbKeycodeToKeysym if available.
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1: addedfa63bb5776733cc58fb6d81b82dda7a6451
User & Date: stwo 2013-01-31 11:41:18
References
2020-02-04
20:43 Ticket [3551802f] Use the Xkb API to simply Tk's keyboard event handling status still Open with 6 other changes artifact: 78e81006 user: fvogel
Context
2013-01-31
11:47
Oops. Missed removing one line in last commit. check-in: 84a425c7 user: stwo tags: trunk
11:41
Bug [3599928]: Use XkbKeycodeToKeysym if available. check-in: addedfa6 user: stwo tags: trunk
11:21
Bug [3602534]: Test for XScreensaver last. check-in: e5a82192 user: stwo tags: trunk
Changes
Hide Diffs Unified Diffs Ignore Whitespace Patch

Changes to unix/configure.

10679
10680
10681
10682
10683
10684
10685





























































































































































10686
10687
10688
10689
10690
10691
10692
    else
	UNIX_FONT_OBJS=tkUnixFont.o
    fi



fi






























































































































































#--------------------------------------------------------------------
# XXX Do this last.
# It might modify XLIBSW which could affect other tests.
#
# Check whether the header and library for the XScreenSaver
# extension are available, and set HAVE_XSS if so.







>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>







10679
10680
10681
10682
10683
10684
10685
10686
10687
10688
10689
10690
10691
10692
10693
10694
10695
10696
10697
10698
10699
10700
10701
10702
10703
10704
10705
10706
10707
10708
10709
10710
10711
10712
10713
10714
10715
10716
10717
10718
10719
10720
10721
10722
10723
10724
10725
10726
10727
10728
10729
10730
10731
10732
10733
10734
10735
10736
10737
10738
10739
10740
10741
10742
10743
10744
10745
10746
10747
10748
10749
10750
10751
10752
10753
10754
10755
10756
10757
10758
10759
10760
10761
10762
10763
10764
10765
10766
10767
10768
10769
10770
10771
10772
10773
10774
10775
10776
10777
10778
10779
10780
10781
10782
10783
10784
10785
10786
10787
10788
10789
10790
10791
10792
10793
10794
10795
10796
10797
10798
10799
10800
10801
10802
10803
10804
10805
10806
10807
10808
10809
10810
10811
10812
10813
10814
10815
10816
10817
10818
10819
10820
10821
10822
10823
10824
10825
10826
10827
10828
10829
10830
10831
10832
10833
10834
10835
10836
10837
10838
10839
10840
10841
10842
10843
10844
10845
10846
10847
10848
10849
    else
	UNIX_FONT_OBJS=tkUnixFont.o
    fi



fi

#--------------------------------------------------------------------
#	Check for XkbKeycodeToKeysym.
#--------------------------------------------------------------------

if test $tk_aqua = no; then
    tk_oldCFlags=$CFLAGS
    tk_oldLibs=$LIBS
    CFLAGS="$CFLAGS $XINCLUDES"
    LIBS="$LIBS $XLIBSW"
    echo "$as_me:$LINENO: checking for X11/XKBlib.h" >&5
echo $ECHO_N "checking for X11/XKBlib.h... $ECHO_C" >&6
if test "${ac_cv_header_X11_XKBlib_h+set}" = set; then
  echo $ECHO_N "(cached) $ECHO_C" >&6
else
  cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h.  */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h.  */
#include <X11/Xlib.h>

#include <X11/XKBlib.h>
_ACEOF
rm -f conftest.$ac_objext
if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
  (eval $ac_compile) 2>conftest.er1
  ac_status=$?
  grep -v '^ *+' conftest.er1 >conftest.err
  rm -f conftest.er1
  cat conftest.err >&5
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); } &&
	 { ac_try='test -z "$ac_c_werror_flag"
			 || test ! -s conftest.err'
  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
  (eval $ac_try) 2>&5
  ac_status=$?
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); }; } &&
	 { ac_try='test -s conftest.$ac_objext'
  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
  (eval $ac_try) 2>&5
  ac_status=$?
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); }; }; then
  ac_cv_header_X11_XKBlib_h=yes
else
  echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5

ac_cv_header_X11_XKBlib_h=no
fi
rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
fi
echo "$as_me:$LINENO: result: $ac_cv_header_X11_XKBlib_h" >&5
echo "${ECHO_T}$ac_cv_header_X11_XKBlib_h" >&6
if test $ac_cv_header_X11_XKBlib_h = yes; then

	xkblib_header_found=yes

else

	xkblib_header_found=no

fi


    if test $xkblib_header_found = "yes" ; then
	echo "$as_me:$LINENO: checking for XkbKeycodeToKeysym in -lX11" >&5
echo $ECHO_N "checking for XkbKeycodeToKeysym in -lX11... $ECHO_C" >&6
if test "${ac_cv_lib_X11_XkbKeycodeToKeysym+set}" = set; then
  echo $ECHO_N "(cached) $ECHO_C" >&6
else
  ac_check_lib_save_LIBS=$LIBS
LIBS="-lX11  $LIBS"
cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h.  */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h.  */

/* Override any gcc2 internal prototype to avoid an error.  */
#ifdef __cplusplus
extern "C"
#endif
/* We use char because int might match the return type of a gcc2
   builtin and then its argument prototype would still apply.  */
char XkbKeycodeToKeysym ();
int
main ()
{
XkbKeycodeToKeysym ();
  ;
  return 0;
}
_ACEOF
rm -f conftest.$ac_objext conftest$ac_exeext
if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
  (eval $ac_link) 2>conftest.er1
  ac_status=$?
  grep -v '^ *+' conftest.er1 >conftest.err
  rm -f conftest.er1
  cat conftest.err >&5
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); } &&
	 { ac_try='test -z "$ac_c_werror_flag"
			 || test ! -s conftest.err'
  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
  (eval $ac_try) 2>&5
  ac_status=$?
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); }; } &&
	 { ac_try='test -s conftest$ac_exeext'
  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
  (eval $ac_try) 2>&5
  ac_status=$?
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); }; }; then
  ac_cv_lib_X11_XkbKeycodeToKeysym=yes
else
  echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5

ac_cv_lib_X11_XkbKeycodeToKeysym=no
fi
rm -f conftest.err conftest.$ac_objext \
      conftest$ac_exeext conftest.$ac_ext
LIBS=$ac_check_lib_save_LIBS
fi
echo "$as_me:$LINENO: result: $ac_cv_lib_X11_XkbKeycodeToKeysym" >&5
echo "${ECHO_T}$ac_cv_lib_X11_XkbKeycodeToKeysym" >&6
if test $ac_cv_lib_X11_XkbKeycodeToKeysym = yes; then

	    xkbkeycodetokeysym_found=yes

else

	    xkbkeycodetokeysym_found=no

fi

    else
	xkbkeycodetokeysym_found=no
    fi
    if test $xkbkeycodetokeysym_found = "yes" ; then

cat >>confdefs.h <<\_ACEOF
#define HAVE_XKBKEYCODETOKEYSYM 1
_ACEOF

    fi
    CFLAGS=$tk_oldCFlags
    LIBS=$tk_oldLibs
fi

#--------------------------------------------------------------------
# XXX Do this last.
# It might modify XLIBSW which could affect other tests.
#
# Check whether the header and library for the XScreenSaver
# extension are available, and set HAVE_XSS if so.

Changes to unix/configure.in.

553
554
555
556
557
558
559






























560
561
562
563
564
565
566
    else
	UNIX_FONT_OBJS=tkUnixFont.o
    fi
    AC_SUBST(XFT_CFLAGS)
    AC_SUBST(XFT_LIBS)
    AC_SUBST(UNIX_FONT_OBJS)
fi































#--------------------------------------------------------------------
# XXX Do this last.
# It might modify XLIBSW which could affect other tests.
#
# Check whether the header and library for the XScreenSaver
# extension are available, and set HAVE_XSS if so.







>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>







553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
    else
	UNIX_FONT_OBJS=tkUnixFont.o
    fi
    AC_SUBST(XFT_CFLAGS)
    AC_SUBST(XFT_LIBS)
    AC_SUBST(UNIX_FONT_OBJS)
fi

#--------------------------------------------------------------------
#	Check for XkbKeycodeToKeysym.
#--------------------------------------------------------------------

if test $tk_aqua = no; then
    tk_oldCFlags=$CFLAGS
    tk_oldLibs=$LIBS
    CFLAGS="$CFLAGS $XINCLUDES"
    LIBS="$LIBS $XLIBSW"
    AC_CHECK_HEADER(X11/XKBlib.h, [
	xkblib_header_found=yes
    ], [
	xkblib_header_found=no
    ], [#include <X11/Xlib.h>])
    if test $xkblib_header_found = "yes" ; then
	AC_CHECK_LIB(X11, XkbKeycodeToKeysym, [
	    xkbkeycodetokeysym_found=yes
	], [
	    xkbkeycodetokeysym_found=no
	])
    else
	xkbkeycodetokeysym_found=no
    fi
    if test $xkbkeycodetokeysym_found = "yes" ; then
	AC_DEFINE(HAVE_XKBKEYCODETOKEYSYM, 1, [Do we have XkbKeycodeToKeysym?])
    fi
    CFLAGS=$tk_oldCFlags
    LIBS=$tk_oldLibs
fi

#--------------------------------------------------------------------
# XXX Do this last.
# It might modify XLIBSW which could affect other tests.
#
# Check whether the header and library for the XScreenSaver
# extension are available, and set HAVE_XSS if so.

Changes to unix/tkUnixKey.c.

1
2
3
4
5
6
7
8
9
10
11
12
13







14
15
16
17
18
19
20
/*
 * tkUnixKey.c --
 *
 *	This file contains routines for dealing with international keyboard
 *	input.
 *
 * Copyright (c) 1997 by Sun Microsystems, Inc.
 *
 * See the file "license.terms" for information on usage and redistribution of
 * this file, and for a DISCLAIMER OF ALL WARRANTIES.
 */

#include "tkInt.h"







#include <X11/XKBlib.h>

/*
 * Prototypes for local functions defined in this file:
 */

/*













>
>
>
>
>
>
>







1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
/*
 * tkUnixKey.c --
 *
 *	This file contains routines for dealing with international keyboard
 *	input.
 *
 * Copyright (c) 1997 by Sun Microsystems, Inc.
 *
 * See the file "license.terms" for information on usage and redistribution of
 * this file, and for a DISCLAIMER OF ALL WARRANTIES.
 */

#include "tkInt.h"

#ifdef HAVE_XKBKEYCODETOKEYSYM
#  include <X11/XKBlib.h>
#else
#  define XkbKeycodeToKeysym(D,K,G,L) XKeycodeToKeysym(D,K,L)
#endif

#include <X11/XKBlib.h>

/*
 * Prototypes for local functions defined in this file:
 */

/*