blob: 53c0ac2e61e46e3125f92d75b224c9b3dcfcb3d0 [file] [log] [blame]
Patrick Williamsc124f4f2015-09-15 14:41:29 -05001Upstream-Status: Inappropriate [disable feature]
2
3---
4 xev.c | 16 ++++++++--------
5 1 file changed, 8 insertions(+), 8 deletions(-)
6
Brad Bishop19323692019-04-05 15:28:33 -04007Index: xev-1.2.3/xev.c
Patrick Williamsc124f4f2015-09-15 14:41:29 -05008===================================================================
Brad Bishop19323692019-04-05 15:28:33 -04009--- xev-1.2.3.orig/xev.c
10+++ xev-1.2.3/xev.c
11@@ -125,17 +125,6 @@ do_KeyPress(XEvent *eventp)
12 nbytes = XLookupString(e, str, 256, &ks, NULL);
Patrick Williamsc124f4f2015-09-15 14:41:29 -050013
14 /* not supposed to call XmbLookupString on a key release event */
15- if (e->type == KeyPress && xic) {
Brad Bishop19323692019-04-05 15:28:33 -040016- do {
17- nmbbytes = XmbLookupString(xic, e, buf, bsize - 1, &ks, &status);
18- buf[nmbbytes] = '\0';
19-
20- if (status == XBufferOverflow) {
21- bsize = nmbbytes + 1;
22- buf = realloc(buf, bsize);
23- }
24- } while (status == XBufferOverflow);
Patrick Williamsc124f4f2015-09-15 14:41:29 -050025- }
Patrick Williamsc124f4f2015-09-15 14:41:29 -050026
27 if (ks == NoSymbol)
Brad Bishop19323692019-04-05 15:28:33 -040028 ksname = "NoSymbol";
29@@ -168,16 +157,6 @@ do_KeyPress(XEvent *eventp)
Patrick Williamsc124f4f2015-09-15 14:41:29 -050030 }
31
32 /* not supposed to call XmbLookupString on a key release event */
33- if (e->type == KeyPress && xic) {
Brad Bishop19323692019-04-05 15:28:33 -040034- printf(" XmbLookupString gives %d bytes: ", nmbbytes);
35- if (nmbbytes > 0) {
36- dump(buf, nmbbytes);
37- printf(" \"%s\"\n", buf);
38- }
39- else {
40- printf("\n");
41- }
42- }
43
44 printf(" XFilterEvent returns: %s\n",
45 XFilterEvent(eventp, e->window) ? "True" : "False");
46@@ -1141,7 +1120,7 @@ parse_event_mask(const char *s, long eve
47 if (s)
48 return True;
Patrick Williamsc124f4f2015-09-15 14:41:29 -050049 }
50- }
Brad Bishop19323692019-04-05 15:28:33 -040051+ }
Patrick Williamsc124f4f2015-09-15 14:41:29 -050052
Brad Bishop19323692019-04-05 15:28:33 -040053 if (s != NULL)
54 fprintf(stderr, "%s: unrecognized event mask '%s'\n", ProgramName, s);
55@@ -1288,37 +1267,6 @@ main(int argc, char **argv)
56 fprintf(stderr, "%s: XSetLocaleModifiers failed\n", ProgramName);
Patrick Williamsc124f4f2015-09-15 14:41:29 -050057 }
58
Brad Bishop19323692019-04-05 15:28:33 -040059- xim = XOpenIM(dpy, NULL, NULL, NULL);
60- if (xim == NULL) {
61- fprintf(stderr, "%s: XOpenIM failed\n", ProgramName);
Patrick Williamsc124f4f2015-09-15 14:41:29 -050062- }
Brad Bishop19323692019-04-05 15:28:33 -040063-
64- if (xim) {
65- imvalret = XGetIMValues(xim, XNQueryInputStyle, &xim_styles, NULL);
66- if (imvalret != NULL || xim_styles == NULL) {
67- fprintf(stderr, "%s: input method doesn't support any styles\n",
68- ProgramName);
69- }
70-
71- if (xim_styles) {
72- xim_style = 0;
73- for (i = 0; i < xim_styles->count_styles; i++) {
74- if (xim_styles->supported_styles[i] ==
75- (XIMPreeditNothing | XIMStatusNothing)) {
76- xim_style = xim_styles->supported_styles[i];
77- break;
78- }
79- }
80-
81- if (xim_style == 0) {
82- fprintf(stderr,
83- "%s: input method doesn't support the style we support\n",
84- ProgramName);
85- }
86- XFree(xim_styles);
87- }
88- }
89-
90 screen = DefaultScreen(dpy);
Patrick Williamsc124f4f2015-09-15 14:41:29 -050091
Brad Bishop19323692019-04-05 15:28:33 -040092 attr.event_mask = event_masks[EVENT_MASK_INDEX_CORE];
93@@ -1373,16 +1321,6 @@ main(int argc, char **argv)
94 printf("Outer window is 0x%lx, inner window is 0x%lx\n", w, subw);
Patrick Williamsc124f4f2015-09-15 14:41:29 -050095 }
96
97- if (xim && xim_style) {
Brad Bishop19323692019-04-05 15:28:33 -040098- xic = XCreateIC(xim,
99- XNInputStyle, xim_style,
100- XNClientWindow, w, XNFocusWindow, w, NULL);
101-
102- if (xic == NULL) {
103- fprintf(stderr, "XCreateIC failed\n");
104- }
Patrick Williamsc124f4f2015-09-15 14:41:29 -0500105- }
Brad Bishop19323692019-04-05 15:28:33 -0400106-
107 have_rr = XRRQueryExtension(dpy, &rr_event_base, &rr_error_base);
Patrick Williamsc124f4f2015-09-15 14:41:29 -0500108 if (have_rr) {
Brad Bishop19323692019-04-05 15:28:33 -0400109 int rr_major, rr_minor;