Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 1 | Upstream-Status: Inappropriate [disable feature] |
| 2 | |
| 3 | --- |
| 4 | xev.c | 16 ++++++++-------- |
| 5 | 1 file changed, 8 insertions(+), 8 deletions(-) |
| 6 | |
Brad Bishop | 1932369 | 2019-04-05 15:28:33 -0400 | [diff] [blame^] | 7 | Index: xev-1.2.3/xev.c |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 8 | =================================================================== |
Brad Bishop | 1932369 | 2019-04-05 15:28:33 -0400 | [diff] [blame^] | 9 | --- 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 Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 13 | |
| 14 | /* not supposed to call XmbLookupString on a key release event */ |
| 15 | - if (e->type == KeyPress && xic) { |
Brad Bishop | 1932369 | 2019-04-05 15:28:33 -0400 | [diff] [blame^] | 16 | - 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 Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 25 | - } |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 26 | |
| 27 | if (ks == NoSymbol) |
Brad Bishop | 1932369 | 2019-04-05 15:28:33 -0400 | [diff] [blame^] | 28 | ksname = "NoSymbol"; |
| 29 | @@ -168,16 +157,6 @@ do_KeyPress(XEvent *eventp) |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 30 | } |
| 31 | |
| 32 | /* not supposed to call XmbLookupString on a key release event */ |
| 33 | - if (e->type == KeyPress && xic) { |
Brad Bishop | 1932369 | 2019-04-05 15:28:33 -0400 | [diff] [blame^] | 34 | - 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 Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 49 | } |
| 50 | - } |
Brad Bishop | 1932369 | 2019-04-05 15:28:33 -0400 | [diff] [blame^] | 51 | + } |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 52 | |
Brad Bishop | 1932369 | 2019-04-05 15:28:33 -0400 | [diff] [blame^] | 53 | 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 Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 57 | } |
| 58 | |
Brad Bishop | 1932369 | 2019-04-05 15:28:33 -0400 | [diff] [blame^] | 59 | - xim = XOpenIM(dpy, NULL, NULL, NULL); |
| 60 | - if (xim == NULL) { |
| 61 | - fprintf(stderr, "%s: XOpenIM failed\n", ProgramName); |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 62 | - } |
Brad Bishop | 1932369 | 2019-04-05 15:28:33 -0400 | [diff] [blame^] | 63 | - |
| 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 Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 91 | |
Brad Bishop | 1932369 | 2019-04-05 15:28:33 -0400 | [diff] [blame^] | 92 | 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 Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 95 | } |
| 96 | |
| 97 | - if (xim && xim_style) { |
Brad Bishop | 1932369 | 2019-04-05 15:28:33 -0400 | [diff] [blame^] | 98 | - 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 Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 105 | - } |
Brad Bishop | 1932369 | 2019-04-05 15:28:33 -0400 | [diff] [blame^] | 106 | - |
| 107 | have_rr = XRRQueryExtension(dpy, &rr_event_base, &rr_error_base); |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 108 | if (have_rr) { |
Brad Bishop | 1932369 | 2019-04-05 15:28:33 -0400 | [diff] [blame^] | 109 | int rr_major, rr_minor; |