no-xf86misc.patch 3.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130
  1. --- a/configure
  2. +++ b/configure
  3. @@ -163,44 +163,6 @@
  4. exit 1
  5. }
  6. -check_xf86misc() {
  7. -
  8. - cat << EOF > tmp.c
  9. -#include <X11/Xlib.h>
  10. -#include <X11/extensions/xf86misc.h>
  11. -int main() {
  12. - XF86MiscSetGrabKeysState(NULL, True);
  13. - return 0;
  14. -}
  15. -EOF
  16. - msg_chkfor "extensions/xf86misc.h"
  17. - if ${CC} ${CFLAGS} -c tmp.c -o /dev/null 2>&3
  18. - then
  19. - echo "ok."
  20. - msg_chkfor "xf86misc"
  21. - if ${CC} ${CFLAGS} tmp.c -o /dev/null ${LDFLAGS} -lX11 -lXxf86misc 2>&3
  22. - then
  23. - echo "ok."
  24. - echo "#_______________________" >&4
  25. - echo "WITH_XF86MISC:=1" >&4
  26. - echo "LIBS += -lXxf86misc" >&4
  27. - echo "" >&4
  28. - return
  29. - fi
  30. - fi
  31. - echo "no."
  32. - echo " "
  33. - echo "!!! WARNING !!!"
  34. - echo " if the xserver is configured to allow"
  35. - echo " 'AllowDeactivateGrabs' or 'AllowClosedownGrabs'"
  36. - echo " people can bypass alock !!! consider"
  37. - echo " to install the xf86misc extension!"
  38. - echo "!!! WARNING !!!"
  39. - echo " "
  40. -}
  41. -
  42. -
  43. -
  44. check_xlib() {
  45. @@ -431,7 +393,6 @@
  46. check_docs
  47. check_tools
  48. check_xlib
  49. -check_xf86misc
  50. check_xlogo16
  51. [ "$CHECK_XPM" -eq 1 ] && check_xpm
  52. [ "$CHECK_XRENDER" -eq 1 ] && check_xrender
  53. --- a/src/GNUmakefile
  54. +++ b/src/GNUmakefile
  55. @@ -46,7 +46,7 @@
  56. ######################
  57. -MODULES = PAM PASSWD HASH XRENDER XCURSOR XF86MISC IMLIB2 XPM
  58. +MODULES = PAM PASSWD HASH XRENDER XCURSOR IMLIB2 XPM
  59. STAND_ALONES = $(subst auth_,,$(SRC_HASH:.c=))
  60. $(foreach module,$(MODULES),$(eval $(call funcAddModule,$(module))))
  61. --- a/src/alock.c
  62. +++ b/src/alock.c
  63. @@ -24,10 +24,6 @@
  64. #include <unistd.h>
  65. #include <poll.h>
  66. -#ifdef HAVE_XF86MISC
  67. -#include <X11/extensions/xf86misc.h>
  68. -#endif
  69. -
  70. /*----------------------------------------------*\
  71. \*----------------------------------------------*/
  72. @@ -405,11 +401,6 @@
  73. struct aXInfo xinfo;
  74. struct aOpts opts;
  75. -#if HAVE_XF86MISC
  76. - int xf86misc_major = -1;
  77. - int xf86misc_minor = -1;
  78. -#endif
  79. -
  80. int arg = 0;
  81. const char* cursor_args = NULL;
  82. const char* background_args = NULL;
  83. @@ -587,23 +578,6 @@
  84. }
  85. }
  86. -#if HAVE_XF86MISC
  87. - {
  88. - if (XF86MiscQueryVersion(xinfo.display, &xf86misc_major, &xf86misc_minor) == True) {
  89. -
  90. - if (xf86misc_major >= 0 &&
  91. - xf86misc_minor >= 5 &&
  92. - XF86MiscSetGrabKeysState(xinfo.display, False) == MiscExtGrabStateLocked) {
  93. -
  94. - printf("%s", "alock: cant disable xserver hotkeys to remove grabs.\n");
  95. - exit(EXIT_FAILURE);
  96. - }
  97. -
  98. - printf("%s", "disabled AllowDeactivateGrabs and AllowClosedownGrabs\n.");
  99. - }
  100. - }
  101. -#endif
  102. -
  103. /* TODO: think about it: do we really need NR_SCREEN cursors ? we grab the
  104. * pointer on :*.0 anyway ... */
  105. if (XGrabPointer(xinfo.display, xinfo.window[0], False, None,
  106. @@ -621,13 +595,6 @@
  107. opts.cursor->deinit(&xinfo);
  108. opts.background->deinit(&xinfo);
  109. -#if HAVE_XF86MISC
  110. - if (xf86misc_major >= 0 && xf86misc_minor >= 5) {
  111. - XF86MiscSetGrabKeysState(xinfo.display, True);
  112. - XFlush(xinfo.display);
  113. - }
  114. -#endif
  115. -
  116. XCloseDisplay(xinfo.display);
  117. return EXIT_SUCCESS;