tigervnc.patch 8.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227
  1. diff -Nur fltk-1.3.2.orig/FL/Enumerations.H fltk-1.3.2/FL/Enumerations.H
  2. --- fltk-1.3.2.orig/FL/Enumerations.H 2012-12-09 19:45:57.000000000 +0100
  3. +++ fltk-1.3.2/FL/Enumerations.H 2013-07-17 19:37:45.785342886 +0200
  4. @@ -909,27 +909,27 @@
  5. /* FIXME: We should renumber these, but that will break the ABI */
  6. enum Fl_Cursor {
  7. FL_CURSOR_DEFAULT = 0, /**< the default cursor, usually an arrow. */
  8. - FL_CURSOR_ARROW = 35, /**< an arrow pointer. */
  9. - FL_CURSOR_CROSS = 66, /**< crosshair. */
  10. - FL_CURSOR_WAIT = 76, /**< busy indicator (e.g. hourglass). */
  11. - FL_CURSOR_INSERT = 77, /**< I-beam. */
  12. - FL_CURSOR_HAND = 31, /**< pointing hand. */
  13. - FL_CURSOR_HELP = 47, /**< question mark pointer. */
  14. - FL_CURSOR_MOVE = 27, /**< 4-pointed arrow or hand. */
  15. + FL_CURSOR_ARROW = 1, /**< an arrow pointer. */
  16. + FL_CURSOR_CROSS = 2, /**< crosshair. */
  17. + FL_CURSOR_WAIT = 3, /**< busy indicator (e.g. hourglass). */
  18. + FL_CURSOR_INSERT = 4, /**< I-beam. */
  19. + FL_CURSOR_HAND = 5, /**< pointing hand. */
  20. + FL_CURSOR_HELP = 6, /**< question mark pointer. */
  21. + FL_CURSOR_MOVE = 7, /**< 4-pointed arrow or hand. */
  22. /* Resize indicators */
  23. - FL_CURSOR_NS = 78, /**< up/down resize. */
  24. - FL_CURSOR_WE = 79, /**< left/right resize. */
  25. - FL_CURSOR_NWSE = 80, /**< diagonal resize. */
  26. - FL_CURSOR_NESW = 81, /**< diagonal resize. */
  27. - FL_CURSOR_N = 70, /**< upwards resize. */
  28. - FL_CURSOR_NE = 69, /**< upwards, right resize. */
  29. - FL_CURSOR_E = 49, /**< rightwards resize. */
  30. - FL_CURSOR_SE = 8, /**< downwards, right resize. */
  31. - FL_CURSOR_S = 9, /**< downwards resize. */
  32. - FL_CURSOR_SW = 7, /**< downwards, left resize. */
  33. - FL_CURSOR_W = 36, /**< leftwards resize. */
  34. - FL_CURSOR_NW = 68, /**< upwards, left resize. */
  35. + FL_CURSOR_NS = 101, /**< up/down resize. */
  36. + FL_CURSOR_WE = 102, /**< left/right resize. */
  37. + FL_CURSOR_NWSE = 103, /**< diagonal resize. */
  38. + FL_CURSOR_NESW = 104, /**< diagonal resize. */
  39. + FL_CURSOR_NE = 110, /**< upwards, right resize. */
  40. + FL_CURSOR_N = 111, /**< upwards resize. */
  41. + FL_CURSOR_NW = 112, /**< upwards, left resize. */
  42. + FL_CURSOR_E = 113, /**< rightwards resize. */
  43. + FL_CURSOR_W = 114, /**< leftwards resize. */
  44. + FL_CURSOR_SE = 115, /**< downwards, right resize. */
  45. + FL_CURSOR_S = 116, /**< downwards resize. */
  46. + FL_CURSOR_SW = 117, /**< downwards, left resize. */
  47. FL_CURSOR_NONE =255 /**< invisible. */
  48. };
  49. diff -Nur fltk-1.3.2.orig/FL/Fl_Widget.H fltk-1.3.2/FL/Fl_Widget.H
  50. --- fltk-1.3.2.orig/FL/Fl_Widget.H 2012-04-23 22:12:06.000000000 +0200
  51. +++ fltk-1.3.2/FL/Fl_Widget.H 2013-07-17 19:37:07.411344886 +0200
  52. @@ -172,6 +172,7 @@
  53. COPIED_TOOLTIP = 1<<17, ///< the widget tooltip is internally copied, its destruction is handled by the widget
  54. FULLSCREEN = 1<<18, ///< a fullscreen window (Fl_Window)
  55. MAC_USE_ACCENTS_MENU = 1<<19, ///< On the Mac OS platform, pressing and holding a key on the keyboard opens an accented-character menu window (Fl_Input_, Fl_Text_Editor)
  56. + SIMPLE_KEYBOARD = 1<<20, ///< the widget wants simple, consistent keypresses and not advanced input (like character composition and CJK input)
  57. // (space for more flags)
  58. USERFLAG3 = 1<<29, ///< reserved for 3rd party extensions
  59. USERFLAG2 = 1<<30, ///< reserved for 3rd party extensions
  60. @@ -790,6 +791,35 @@
  61. */
  62. void set_active() {flags_ &= ~INACTIVE;}
  63. + /**
  64. + Returns if the widget sees a simplified keyboard model or not.
  65. +
  66. + Normally widgets get a full-featured keyboard model that is geared
  67. + towards text input. This includes support for compose sequences and
  68. + advanced input methods, commonly used for asian writing system. This
  69. + system however has downsides in that extra graphic can be presented
  70. + to the user and that a physical key press doesn't correspond directly
  71. + to a FLTK event.
  72. +
  73. + Widgets that need a direct correspondence between actual key events
  74. + and those seen by the widget can swith to the simplified keyboard
  75. + model.
  76. +
  77. + \retval 0 if the widget uses the normal keyboard model
  78. + \see set_changed(), clear_changed()
  79. + */
  80. + unsigned int simple_keyboard() const {return flags_&SIMPLE_KEYBOARD;}
  81. +
  82. + /** Marks a widget to use the simple keyboard model.
  83. + \see changed(), clear_changed()
  84. + */
  85. + void set_simple_keyboard() {flags_ |= SIMPLE_KEYBOARD;}
  86. +
  87. + /** Marks a widget to use the normal keyboard model.
  88. + \see changed(), set_changed()
  89. + */
  90. + void set_normal_keyboard() {flags_ &= ~SIMPLE_KEYBOARD;}
  91. +
  92. /** Gives the widget the keyboard focus.
  93. Tries to make this widget be the Fl::focus() widget, by first sending
  94. it an FL_FOCUS event, and if it returns non-zero, setting
  95. diff -Nur fltk-1.3.2.orig/src/Fl_cocoa.mm fltk-1.3.2/src/Fl_cocoa.mm
  96. --- fltk-1.3.2.orig/src/Fl_cocoa.mm 2012-11-30 19:20:36.000000000 +0100
  97. +++ fltk-1.3.2/src/Fl_cocoa.mm 2013-07-17 19:38:17.320341239 +0200
  98. @@ -724,7 +723,7 @@
  99. return NO; // prevent the caption to be redrawn as active on click
  100. // when another modal window is currently the key win
  101. - return !(w->tooltip_window() || w->menu_window());
  102. + return !w->tooltip_window();
  103. }
  104. - (BOOL)canBecomeMainWindow
  105. diff -Nur fltk-1.3.2.orig/src/Fl.cxx fltk-1.3.2/src/Fl.cxx
  106. --- fltk-1.3.2.orig/src/Fl.cxx 2012-08-16 22:59:36.000000000 +0200
  107. +++ fltk-1.3.2/src/Fl.cxx 2013-07-17 19:38:01.696342059 +0200
  108. @@ -70,6 +70,8 @@
  109. extern double fl_mac_flush_and_wait(double time_to_wait, char in_idle);
  110. #endif // WIN32
  111. +extern void fl_update_focus(void);
  112. +
  113. //
  114. // Globals...
  115. //
  116. @@ -876,6 +941,8 @@
  117. fl_oldfocus = p;
  118. }
  119. e_number = old_event;
  120. + // let the platform code do what it needs
  121. + fl_update_focus();
  122. }
  123. }
  124. diff -Nur fltk-1.3.2.orig/src/Fl_grab.cxx fltk-1.3.2/src/Fl_grab.cxx
  125. --- fltk-1.3.2.orig/src/Fl_grab.cxx 2012-03-23 17:47:53.000000000 +0100
  126. +++ fltk-1.3.2/src/Fl_grab.cxx 2013-07-17 19:37:07.411344886 +0200
  127. @@ -29,6 +29,7 @@
  128. // override_redirect, it does similar things on WIN32.
  129. extern void fl_fix_focus(); // in Fl.cxx
  130. +void fl_update_focus(void);
  131. #ifdef WIN32
  132. // We have to keep track of whether we have captured the mouse, since
  133. @@ -80,6 +81,7 @@
  134. #endif
  135. }
  136. grab_ = win;
  137. + fl_update_focus();
  138. } else {
  139. if (grab_) {
  140. #ifdef WIN32
  141. @@ -98,6 +100,7 @@
  142. XFlush(fl_display);
  143. #endif
  144. grab_ = 0;
  145. + fl_update_focus();
  146. fl_fix_focus();
  147. }
  148. }
  149. diff -Nur fltk-1.3.2.orig/src/xutf8/imKStoUCS.c fltk-1.3.2/src/xutf8/imKStoUCS.c
  150. --- fltk-1.3.2.orig/src/xutf8/imKStoUCS.c 2009-03-13 23:43:43.000000000 +0100
  151. +++ fltk-1.3.2/src/xutf8/imKStoUCS.c 2013-07-17 19:37:07.412344891 +0200
  152. @@ -266,6 +266,12 @@
  153. 0x20a8, 0x20a9, 0x20aa, 0x20ab, 0x20ac /* 0x20a8-0x20af */
  154. };
  155. +static unsigned short const keysym_to_unicode_fe50_fe60[] = {
  156. + 0x0300, 0x0301, 0x0302, 0x0303, 0x0304, 0x0306, 0x0307, 0x0308, /* 0xfe50-0xfe57 */
  157. + 0x030a, 0x030b, 0x030c, 0x0327, 0x0328, 0x1da5, 0x3099, 0x309a, /* 0xfe58-0xfe5f */
  158. + 0x0323 /* 0xfe60-0xfe67 */
  159. +};
  160. +
  161. static unsigned int
  162. KeySymToUcs4(KeySym keysym)
  163. {
  164. @@ -315,6 +321,8 @@
  165. return keysym_to_unicode_1e9f_1eff[keysym - 0x1e9f];
  166. else if (keysym > 0x209f && keysym < 0x20ad)
  167. return keysym_to_unicode_20a0_20ac[keysym - 0x20a0];
  168. + else if (keysym > 0xfe4f && keysym < 0xfe61)
  169. + return keysym_to_unicode_fe50_fe60[keysym - 0xfe50];
  170. else
  171. return 0;
  172. }
  173. diff -Nur fltk-1.3.2.orig/src/Fl_x.cxx fltk-1.3.2/src/Fl_x.cxx
  174. --- fltk-1.3.2.orig/src/Fl_x.cxx 2012-10-16 17:35:34.000000000 +0200
  175. +++ fltk-1.3.2/src/Fl_x.cxx 2013-07-17 19:38:17.326341239 +0200
  176. @@ -583,6 +600,30 @@
  177. }
  178. }
  179. +extern Fl_Window *fl_xfocus;
  180. +
  181. +void fl_update_focus(void)
  182. +{
  183. + Fl_Widget *focus;
  184. +
  185. + focus = Fl::grab();
  186. + if (!focus)
  187. + focus = Fl::focus();
  188. + if (!focus)
  189. + return;
  190. +
  191. + if (focus->simple_keyboard()) {
  192. + fl_xim_deactivate();
  193. + } else {
  194. + // fl_xfocus should always be set if something has focus, but let's
  195. + // play it safe
  196. + if (!fl_xfocus || !fl_xid(fl_xfocus))
  197. + return;
  198. +
  199. + fl_xim_activate(fl_xid(fl_xfocus));
  200. + }
  201. +}
  202. +
  203. void fl_open_display() {
  204. if (fl_display) return;
  205. --- fltk-1.3.2.orig/src/Fl_x.cxx (revision 10433)
  206. +++ fltk-1.3.2/src/Fl_x.cxx (revision 10434)
  207. @@ -2211,6 +2211,7 @@
  208. static int result = -1;
  209. if (result == -1) {
  210. + fl_open_display();
  211. result = 0;
  212. unsigned long nitems;
  213. unsigned long *words = 0;