Hello community, here is the log from the commit of package xev for openSUSE:Factory checked in at 2020-07-18 21:02:02 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/xev (Old) and /work/SRC/openSUSE:Factory/.xev.new.3592 (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "xev" Sat Jul 18 21:02:02 2020 rev:11 rq:821629 version:1.2.4 Changes: -------- --- /work/SRC/openSUSE:Factory/xev/xev.changes 2019-02-26 22:19:32.722126898 +0100 +++ /work/SRC/openSUSE:Factory/.xev.new.3592/xev.changes 2020-07-18 21:02:34.259583628 +0200 @@ -1,0 +2,7 @@ +Sat Jul 18 09:36:06 UTC 2020 - Stefan Dirsch <[email protected]> + +- update to version 1.2.4 + * Add option "-1" to display only a single line per event +- refreshed u_Add-event-filter-for-motion-and-button-events.patch + +------------------------------------------------------------------- Old: ---- xev-1.2.3.tar.bz2 xev-1.2.3.tar.bz2.sig New: ---- xev-1.2.4.tar.bz2 xev-1.2.4.tar.bz2.sig ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ xev.spec ++++++ --- /var/tmp/diff_new_pack.PBkQ2o/_old 2020-07-18 21:02:38.587588280 +0200 +++ /var/tmp/diff_new_pack.PBkQ2o/_new 2020-07-18 21:02:38.587588280 +0200 @@ -1,7 +1,7 @@ # # spec file for package xev # -# Copyright (c) 2019 SUSE LINUX GmbH, Nuernberg, Germany. +# Copyright (c) 2020 SUSE LLC # # All modifications and additions to the file contributed by third parties # remain the property of their copyright owners, unless otherwise agreed @@ -12,17 +12,17 @@ # license that conforms to the Open Source Definition (Version 1.9) # published by the Open Source Initiative. -# Please submit bugfixes or comments via http://bugs.opensuse.org/ +# Please submit bugfixes or comments via https://bugs.opensuse.org/ # Name: xev -Version: 1.2.3 +Version: 1.2.4 Release: 0 Summary: Utility to print contents of X events License: X11 Group: System/X11/Utilities -Url: http://xorg.freedesktop.org/ +URL: http://xorg.freedesktop.org/ Source0: http://xorg.freedesktop.org/releases/individual/app/%{name}-%{version}.tar.bz2 Source1: http://xorg.freedesktop.org/releases/individual/app/%{name}-%{version}.tar.bz2.sig Source2: %name.keyring ++++++ u_Add-event-filter-for-motion-and-button-events.patch ++++++ --- /var/tmp/diff_new_pack.PBkQ2o/_old 2020-07-18 21:02:38.611588306 +0200 +++ /var/tmp/diff_new_pack.PBkQ2o/_new 2020-07-18 21:02:38.611588306 +0200 @@ -13,10 +13,10 @@ xev.c | 7 ++++++- 2 files changed, 7 insertions(+), 2 deletions(-) -Index: xev-1.2.3/man/xev.man +Index: xev-1.2.4/man/xev.man =================================================================== ---- xev-1.2.3.orig/man/xev.man -+++ xev-1.2.3/man/xev.man +--- xev-1.2.4.orig/man/xev.man ++++ xev-1.2.4/man/xev.man @@ -62,7 +62,7 @@ The option can be specified multiple times to select multiple types of events. When not specified, all events are selected. @@ -26,11 +26,11 @@ .TP 8 .B \-version This option prints the program version and exits. -Index: xev-1.2.3/xev.c +Index: xev-1.2.4/xev.c =================================================================== ---- xev-1.2.3.orig/xev.c -+++ xev-1.2.3/xev.c -@@ -1051,7 +1051,7 @@ usage(const char *errmsg) +--- xev-1.2.4.orig/xev.c ++++ xev-1.2.4/xev.c +@@ -1120,7 +1120,7 @@ usage(const char *errmsg) " -event event_mask select 'event_mask' events\n" " Supported event masks: keyboard mouse expose visibility structure\n" " substructure focus property colormap\n" @@ -38,8 +38,8 @@ +" owner_grab_button randr motion button\n" " This option can be specified multiple times to select multiple\n" " event masks.\n" - " -version print version and exit\n" -@@ -1100,6 +1100,11 @@ parse_event_mask(const char *s, long eve + " -1 display only a single line per event\n" +@@ -1170,6 +1170,11 @@ parse_event_mask(const char *s, long eve LeaveWindowMask | PointerMotionMask | Button1MotionMask | Button2MotionMask | Button3MotionMask | Button4MotionMask | Button5MotionMask | ButtonMotionMask }, ++++++ xev-1.2.3.tar.bz2 -> xev-1.2.4.tar.bz2 ++++++ ++++ 5795 lines of diff (skipped) ++++ retrying with extended exclude list diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh old/xev-1.2.3/ChangeLog new/xev-1.2.4/ChangeLog --- old/xev-1.2.3/ChangeLog 2019-02-19 23:22:46.000000000 +0100 +++ new/xev-1.2.4/ChangeLog 2020-07-18 00:08:41.000000000 +0200 @@ -1,3 +1,17 @@ +commit b798a62cb701050381ed8b05c2fb7204357a7241 +Author: Matt Turner <[email protected]> +Date: Fri Jul 17 15:07:14 2020 -0700 + + xev 1.2.4 + + Signed-off-by: Matt Turner <[email protected]> + +commit c51ca8f59ce5fff6b8c0705bd296460d8116cff2 +Author: Piotr Henryk Dabrowski <[email protected]> +Date: Mon Apr 6 05:11:28 2020 +0200 + + Add option "-1" to display only a single line per event + commit 699ec4772f024e70dbb5474921acd4977ecfce4c Author: Alan Coopersmith <[email protected]> Date: Tue Feb 19 14:21:20 2019 -0800 diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh old/xev-1.2.3/compile new/xev-1.2.4/compile --- old/xev-1.2.3/compile 2019-02-19 23:22:40.000000000 +0100 +++ new/xev-1.2.4/compile 2020-07-18 00:08:39.000000000 +0200 @@ -1,9 +1,9 @@ #! /bin/sh # Wrapper for compilers which do not understand '-c -o'. -scriptversion=2012-10-14.11; # UTC +scriptversion=2018-03-07.03; # UTC -# Copyright (C) 1999-2014 Free Software Foundation, Inc. +# Copyright (C) 1999-2018 Free Software Foundation, Inc. # Written by Tom Tromey <[email protected]>. # # This program is free software; you can redistribute it and/or modify @@ -17,7 +17,7 @@ # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License -# along with this program. If not, see <http://www.gnu.org/licenses/>. +# along with this program. If not, see <https://www.gnu.org/licenses/>. # As a special exception to the GNU General Public License, if you # distribute this file as part of a program that contains a @@ -255,7 +255,8 @@ echo "compile $scriptversion" exit $? ;; - cl | *[/\\]cl | cl.exe | *[/\\]cl.exe ) + cl | *[/\\]cl | cl.exe | *[/\\]cl.exe | \ + icl | *[/\\]icl | icl.exe | *[/\\]icl.exe ) func_cl_wrapper "$@" # Doesn't return... ;; esac @@ -339,9 +340,9 @@ # Local Variables: # mode: shell-script # sh-indentation: 2 -# eval: (add-hook 'write-file-hooks 'time-stamp) +# eval: (add-hook 'before-save-hook 'time-stamp) # time-stamp-start: "scriptversion=" # time-stamp-format: "%:y-%02m-%02d.%02H" -# time-stamp-time-zone: "UTC" +# time-stamp-time-zone: "UTC0" # time-stamp-end: "; # UTC" # End: diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh old/xev-1.2.3/configure.ac new/xev-1.2.4/configure.ac --- old/xev-1.2.3/configure.ac 2019-02-19 23:22:36.000000000 +0100 +++ new/xev-1.2.4/configure.ac 2020-07-18 00:08:37.000000000 +0200 @@ -22,7 +22,7 @@ # Initialize Autoconf AC_PREREQ([2.60]) -AC_INIT([xev], [1.2.3], +AC_INIT([xev], [1.2.4], [https://gitlab.freedesktop.org/xorg/app/xev/issues], [xev]) AC_CONFIG_SRCDIR([Makefile.am]) AC_CONFIG_HEADERS([config.h]) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh old/xev-1.2.3/missing new/xev-1.2.4/missing --- old/xev-1.2.3/missing 2019-02-19 23:22:40.000000000 +0100 +++ new/xev-1.2.4/missing 2020-07-18 00:08:39.000000000 +0200 @@ -1,9 +1,9 @@ #! /bin/sh # Common wrapper for a few potentially missing GNU programs. -scriptversion=2013-10-28.13; # UTC +scriptversion=2018-03-07.03; # UTC -# Copyright (C) 1996-2014 Free Software Foundation, Inc. +# Copyright (C) 1996-2018 Free Software Foundation, Inc. # Originally written by Fran,cois Pinard <[email protected]>, 1996. # This program is free software; you can redistribute it and/or modify @@ -17,7 +17,7 @@ # GNU General Public License for more details. # You should have received a copy of the GNU General Public License -# along with this program. If not, see <http://www.gnu.org/licenses/>. +# along with this program. If not, see <https://www.gnu.org/licenses/>. # As a special exception to the GNU General Public License, if you # distribute this file as part of a program that contains a @@ -101,9 +101,9 @@ exit $st fi -perl_URL=http://www.perl.org/ -flex_URL=http://flex.sourceforge.net/ -gnu_software_URL=http://www.gnu.org/software +perl_URL=https://www.perl.org/ +flex_URL=https://github.com/westes/flex +gnu_software_URL=https://www.gnu.org/software program_details () { @@ -207,9 +207,9 @@ exit $st # Local variables: -# eval: (add-hook 'write-file-hooks 'time-stamp) +# eval: (add-hook 'before-save-hook 'time-stamp) # time-stamp-start: "scriptversion=" # time-stamp-format: "%:y-%02m-%02d.%02H" -# time-stamp-time-zone: "UTC" +# time-stamp-time-zone: "UTC0" # time-stamp-end: "; # UTC" # End: diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh old/xev-1.2.3/xev.c new/xev-1.2.4/xev.c --- old/xev-1.2.3/xev.c 2019-02-19 23:22:36.000000000 +0100 +++ new/xev-1.2.4/xev.c 2020-07-18 00:08:37.000000000 +0200 @@ -35,6 +35,7 @@ #ifdef HAVE_CONFIG_H # include "config.h" #endif +#include <stdarg.h> #include <stdio.h> #include <stdlib.h> #include <ctype.h> @@ -78,31 +79,80 @@ Bool have_rr; int rr_event_base, rr_error_base; +Bool single_line = False; + enum EventMaskIndex { EVENT_MASK_INDEX_CORE, EVENT_MASK_INDEX_RANDR, NUM_EVENT_MASKS }; +enum OutputFlags { + InitialNewLine = 1, + Indent = 2, + NewLine = 4, +}; + static void usage(const char *errmsg) _X_NORETURN; static void +output_new_line(void) +{ + if (!single_line) { + printf("\n"); + } +} + +static void +_X_ATTRIBUTE_PRINTF(2, 3) +output(enum OutputFlags flags, const char* format, ...) +{ + va_list args; + + if (flags & InitialNewLine) { + output_new_line(); + } + if (flags & Indent) { + printf(single_line ? " " : " "); + } + + va_start(args, format); + vprintf(format, args); + va_end(args); + + if (flags & NewLine) { + output_new_line(); + } +} + +static void +graceful_exit(int status) +{ + if (single_line) { + printf("\n"); + } + fflush(stdout); + exit(status); +} + +static void prologue(XEvent *eventp, const char *event_name) { XAnyEvent *e = (XAnyEvent *) eventp; - printf("\n%s event, serial %ld, synthetic %s, window 0x%lx,\n", + output(InitialNewLine | NewLine, + "%s event, serial %ld, synthetic %s, window 0x%lx,", event_name, e->serial, e->send_event ? Yes : No, e->window); } static void dump(char *str, int len) { - printf("("); + output(0, "("); len--; while (len-- > 0) - printf("%02x ", (unsigned char) *str++); - printf("%02x)", (unsigned char) *str++); + output(0, "%02x ", (unsigned char) *str++); + output(0, "%02x)", (unsigned char) *str++); } static void @@ -146,40 +196,42 @@ kc_set = True; } - printf(" root 0x%lx, subw 0x%lx, time %lu, (%d,%d), root:(%d,%d),\n", + output(Indent | NewLine, + "root 0x%lx, subw 0x%lx, time %lu, (%d,%d), root:(%d,%d),", e->root, e->subwindow, e->time, e->x, e->y, e->x_root, e->y_root); - printf(" state 0x%x, keycode %u (keysym 0x%lx, %s), same_screen %s,\n", + output(Indent | NewLine, + "state 0x%x, keycode %u (keysym 0x%lx, %s), same_screen %s,", e->state, e->keycode, (unsigned long) ks, ksname, e->same_screen ? Yes : No); if (kc_set && e->keycode != kc) - printf(" XKeysymToKeycode returns keycode: %u\n", kc); + output(Indent | NewLine, "XKeysymToKeycode returns keycode: %u", kc); if (nbytes < 0) nbytes = 0; if (nbytes > 256) nbytes = 256; str[nbytes] = '\0'; - printf(" XLookupString gives %d bytes: ", nbytes); + output(Indent, "XLookupString gives %d bytes: ", nbytes); if (nbytes > 0) { dump(str, nbytes); - printf(" \"%s\"\n", str); + output(NewLine, " \"%s\"", str); } else { - printf("\n"); + output_new_line(); } /* not supposed to call XmbLookupString on a key release event */ if (e->type == KeyPress && xic) { - printf(" XmbLookupString gives %d bytes: ", nmbbytes); + output(Indent, "XmbLookupString gives %d bytes: ", nmbbytes); if (nmbbytes > 0) { dump(buf, nmbbytes); - printf(" \"%s\"\n", buf); + output(NewLine, " \"%s\"", buf); } else { - printf("\n"); + output_new_line(); } } - printf(" XFilterEvent returns: %s\n", + output(Indent | NewLine, "XFilterEvent returns: %s", XFilterEvent(eventp, e->window) ? "True" : "False"); } @@ -194,9 +246,10 @@ { XButtonEvent *e = (XButtonEvent *) eventp; - printf(" root 0x%lx, subw 0x%lx, time %lu, (%d,%d), root:(%d,%d),\n", + output(Indent | NewLine, + "root 0x%lx, subw 0x%lx, time %lu, (%d,%d), root:(%d,%d),", e->root, e->subwindow, e->time, e->x, e->y, e->x_root, e->y_root); - printf(" state 0x%x, button %u, same_screen %s\n", + output(Indent | NewLine, "state 0x%x, button %u, same_screen %s", e->state, e->button, e->same_screen ? Yes : No); } @@ -211,9 +264,10 @@ { XMotionEvent *e = (XMotionEvent *) eventp; - printf(" root 0x%lx, subw 0x%lx, time %lu, (%d,%d), root:(%d,%d),\n", + output(Indent | NewLine, + "root 0x%lx, subw 0x%lx, time %lu, (%d,%d), root:(%d,%d),", e->root, e->subwindow, e->time, e->x, e->y, e->x_root, e->y_root); - printf(" state 0x%x, is_hint %u, same_screen %s\n", + output(Indent | NewLine, "state 0x%x, is_hint %u, same_screen %s", e->state, e->is_hint, e->same_screen ? Yes : No); } @@ -274,11 +328,13 @@ break; } - printf(" root 0x%lx, subw 0x%lx, time %lu, (%d,%d), root:(%d,%d),\n", + output(Indent | NewLine, + "root 0x%lx, subw 0x%lx, time %lu, (%d,%d), root:(%d,%d),", e->root, e->subwindow, e->time, e->x, e->y, e->x_root, e->y_root); - printf(" mode %s, detail %s, same_screen %s,\n", + output(Indent | NewLine, "mode %s, detail %s, same_screen %s,", mode, detail, e->same_screen ? Yes : No); - printf(" focus %s, state %u\n", e->focus ? Yes : No, e->state); + output(Indent | NewLine, "focus %s, state %u", + e->focus ? Yes : No, e->state); } static void @@ -344,7 +400,7 @@ break; } - printf(" mode %s, detail %s\n", mode, detail); + output(Indent | NewLine, "mode %s, detail %s", mode, detail); } static void @@ -359,13 +415,14 @@ XKeymapEvent *e = (XKeymapEvent *) eventp; int i; - printf(" keys: "); + output(Indent, "keys: "); for (i = 0; i < 32; i++) { - if (i == 16) - printf("\n "); - printf("%-3u ", (unsigned int) e->key_vector[i]); + if (i == 16 && !single_line) { + output(InitialNewLine | Indent, " "); + } + output(0, "%-3u ", (unsigned int) e->key_vector[i]); } - printf("\n"); + output_new_line(); } static void @@ -373,7 +430,7 @@ { XExposeEvent *e = (XExposeEvent *) eventp; - printf(" (%d,%d), width %d, height %d, count %d\n", + output(Indent | NewLine, "(%d,%d), width %d, height %d, count %d", e->x, e->y, e->width, e->height, e->count); } @@ -397,9 +454,9 @@ break; } - printf(" (%d,%d), width %d, height %d, count %d,\n", + output(Indent | NewLine, "(%d,%d), width %d, height %d, count %d,", e->x, e->y, e->width, e->height, e->count); - printf(" major %s, minor %d\n", m, e->minor_code); + output(Indent | NewLine, "major %s, minor %d", m, e->minor_code); } static void @@ -422,7 +479,7 @@ break; } - printf(" major %s, minor %d\n", m, e->minor_code); + output(Indent | NewLine, "major %s, minor %d", m, e->minor_code); return; } @@ -449,7 +506,7 @@ break; } - printf(" state %s\n", v); + output(Indent | NewLine, "state %s", v); } static void @@ -457,9 +514,10 @@ { XCreateWindowEvent *e = (XCreateWindowEvent *) eventp; - printf(" parent 0x%lx, window 0x%lx, (%d,%d), width %d, height %d\n", + output(Indent | NewLine, + "parent 0x%lx, window 0x%lx, (%d,%d), width %d, height %d", e->parent, e->window, e->x, e->y, e->width, e->height); - printf("border_width %d, override %s\n", + output(NewLine, "border_width %d, override %s", e->border_width, e->override_redirect ? Yes : No); } @@ -468,7 +526,7 @@ { XDestroyWindowEvent *e = (XDestroyWindowEvent *) eventp; - printf(" event 0x%lx, window 0x%lx\n", e->event, e->window); + output(Indent | NewLine, "event 0x%lx, window 0x%lx", e->event, e->window); } static void @@ -476,7 +534,7 @@ { XUnmapEvent *e = (XUnmapEvent *) eventp; - printf(" event 0x%lx, window 0x%lx, from_configure %s\n", + output(Indent | NewLine, "event 0x%lx, window 0x%lx, from_configure %s", e->event, e->window, e->from_configure ? Yes : No); } @@ -485,7 +543,7 @@ { XMapEvent *e = (XMapEvent *) eventp; - printf(" event 0x%lx, window 0x%lx, override %s\n", + output(Indent | NewLine, "event 0x%lx, window 0x%lx, override %s", e->event, e->window, e->override_redirect ? Yes : No); } @@ -494,7 +552,8 @@ { XMapRequestEvent *e = (XMapRequestEvent *) eventp; - printf(" parent 0x%lx, window 0x%lx\n", e->parent, e->window); + output(Indent | NewLine, "parent 0x%lx, window 0x%lx", + e->parent, e->window); } static void @@ -502,9 +561,9 @@ { XReparentEvent *e = (XReparentEvent *) eventp; - printf(" event 0x%lx, window 0x%lx, parent 0x%lx,\n", + output(Indent | NewLine, "event 0x%lx, window 0x%lx, parent 0x%lx,", e->event, e->window, e->parent); - printf(" (%d,%d), override %s\n", e->x, e->y, + output(Indent | NewLine, "(%d,%d), override %s", e->x, e->y, e->override_redirect ? Yes : No); } @@ -513,9 +572,10 @@ { XConfigureEvent *e = (XConfigureEvent *) eventp; - printf(" event 0x%lx, window 0x%lx, (%d,%d), width %d, height %d,\n", + output(Indent | NewLine, + "event 0x%lx, window 0x%lx, (%d,%d), width %d, height %d,", e->event, e->window, e->x, e->y, e->width, e->height); - printf(" border_width %d, above 0x%lx, override %s\n", + output(Indent | NewLine, "border_width %d, above 0x%lx, override %s", e->border_width, e->above, e->override_redirect ? Yes : No); } @@ -548,9 +608,11 @@ break; } - printf(" parent 0x%lx, window 0x%lx, (%d,%d), width %d, height %d,\n", + output(Indent | NewLine, + "parent 0x%lx, window 0x%lx, (%d,%d), width %d, height %d,", e->parent, e->window, e->x, e->y, e->width, e->height); - printf(" border_width %d, above 0x%lx, detail %s, value 0x%lx\n", + output(Indent | NewLine, + "border_width %d, above 0x%lx, detail %s, value 0x%lx", e->border_width, e->above, detail, e->value_mask); } @@ -559,7 +621,7 @@ { XGravityEvent *e = (XGravityEvent *) eventp; - printf(" event 0x%lx, window 0x%lx, (%d,%d)\n", + output(Indent | NewLine, "event 0x%lx, window 0x%lx, (%d,%d)", e->event, e->window, e->x, e->y); } @@ -568,7 +630,7 @@ { XResizeRequestEvent *e = (XResizeRequestEvent *) eventp; - printf(" width %d, height %d\n", e->width, e->height); + output(Indent | NewLine, "width %d, height %d", e->width, e->height); } static void @@ -591,7 +653,8 @@ break; } - printf(" event 0x%lx, window 0x%lx, place %s\n", e->event, e->window, p); + output(Indent | NewLine, "event 0x%lx, window 0x%lx, place %s", + e->event, e->window, p); } static void @@ -614,7 +677,7 @@ break; } - printf(" parent 0x%lx, window 0x%lx, place %s\n", + output(Indent | NewLine, "parent 0x%lx, window 0x%lx, place %s", e->parent, e->window, p); } @@ -639,7 +702,7 @@ break; } - printf(" atom 0x%lx (%s), time %lu, state %s\n", + output(Indent | NewLine, "atom 0x%lx (%s), time %lu, state %s", e->atom, aname ? aname : Unknown, e->time, s); XFree(aname); @@ -651,7 +714,7 @@ XSelectionClearEvent *e = (XSelectionClearEvent *) eventp; char *sname = XGetAtomName(dpy, e->selection); - printf(" selection 0x%lx (%s), time %lu\n", + output(Indent | NewLine, "selection 0x%lx (%s), time %lu", e->selection, sname ? sname : Unknown, e->time); XFree(sname); @@ -665,9 +728,11 @@ char *tname = XGetAtomName(dpy, e->target); char *pname = XGetAtomName(dpy, e->property); - printf(" owner 0x%lx, requestor 0x%lx, selection 0x%lx (%s),\n", + output(Indent | NewLine, + "owner 0x%lx, requestor 0x%lx, selection 0x%lx (%s),", e->owner, e->requestor, e->selection, sname ? sname : Unknown); - printf(" target 0x%lx (%s), property 0x%lx (%s), time %lu\n", + output(Indent | NewLine, + "target 0x%lx (%s), property 0x%lx (%s), time %lu", e->target, tname ? tname : Unknown, e->property, pname ? pname : Unknown, e->time); @@ -684,10 +749,10 @@ char *tname = XGetAtomName(dpy, e->target); char *pname = XGetAtomName(dpy, e->property); - printf(" selection 0x%lx (%s), target 0x%lx (%s),\n", + output(Indent | NewLine, "selection 0x%lx (%s), target 0x%lx (%s),", e->selection, sname ? sname : Unknown, e->target, tname ? tname : Unknown); - printf(" property 0x%lx (%s), time %lu\n", + output(Indent | NewLine, "property 0x%lx (%s), time %lu", e->property, pname ? pname : Unknown, e->time); XFree(sname); @@ -715,7 +780,7 @@ break; } - printf(" colormap 0x%lx, new %s, state %s\n", + output(Indent | NewLine, "colormap 0x%lx, new %s, state %s", e->colormap, e->new ? Yes : No, s); } @@ -729,13 +794,14 @@ if (e->message_type == wm_protocols) { char *message = XGetAtomName(dpy, e->data.l[0]); - printf(" message_type 0x%lx (%s), format %d, message 0x%lx (%s)\n", + output(Indent | NewLine, + "message_type 0x%lx (%s), format %d, message 0x%lx (%s)", e->message_type, mname ? mname : Unknown, e->format, e->data.l[0], message); XFree(message); } else { - printf(" message_type 0x%lx (%s), format %d\n", + output(Indent | NewLine, "message_type 0x%lx (%s), format %d", e->message_type, mname ? mname : Unknown, e->format); } @@ -743,8 +809,10 @@ if (e->format == 32 && e->message_type == wm_protocols - && (Atom) e->data.l[0] == wm_delete_window) - exit(0); + && (Atom) e->data.l[0] == wm_delete_window + ) { + graceful_exit(0); + } } static void @@ -770,7 +838,7 @@ break; } - printf(" request %s, first_keycode %d, count %d\n", + output(Indent | NewLine, "request %s, first_keycode %d, count %d", r, e->first_keycode, e->count); XRefreshKeyboardMapping(e); } @@ -780,25 +848,25 @@ { switch (subpixel_order) { case SubPixelUnknown: - printf("SubPixelUnknown"); + output(0, "SubPixelUnknown"); return; case SubPixelHorizontalRGB: - printf("SubPixelHorizontalRGB"); + output(0, "SubPixelHorizontalRGB"); return; case SubPixelHorizontalBGR: - printf("SubPixelHorizontalBGR"); + output(0, "SubPixelHorizontalBGR"); return; case SubPixelVerticalRGB: - printf("SubPixelVerticalRGB"); + output(0, "SubPixelVerticalRGB"); return; case SubPixelVerticalBGR: - printf("SubPixelVerticalBGR"); + output(0, "SubPixelVerticalBGR"); return; case SubPixelNone: - printf("SubPixelNone"); + output(0, "SubPixelNone"); return; default: - printf("%d", subpixel_order); + output(0, "%d", subpixel_order); } } @@ -806,21 +874,21 @@ print_Rotation(Rotation rotation) { if (rotation & RR_Rotate_0) - printf("RR_Rotate_0"); + output(0, "RR_Rotate_0"); else if (rotation & RR_Rotate_90) - printf("RR_Rotate_90"); + output(0, "RR_Rotate_90"); else if (rotation & RR_Rotate_180) - printf("RR_Rotate_180"); + output(0, "RR_Rotate_180"); else if (rotation & RR_Rotate_270) - printf("RR_Rotate_270"); + output(0, "RR_Rotate_270"); else { - printf("%d", rotation); + output(0, "%d", rotation); return; } if (rotation & RR_Reflect_X) - printf(", RR_Reflect_X"); + output(0, ", RR_Reflect_X"); if (rotation & RR_Reflect_Y) - printf(", RR_Reflect_Y"); + output(0, ", RR_Reflect_Y"); } static void @@ -828,16 +896,16 @@ { switch (connection) { case RR_Connected: - printf("RR_Connected"); + output(0, "RR_Connected"); return; case RR_Disconnected: - printf("RR_Disconnected"); + output(0, "RR_Disconnected"); return; case RR_UnknownConnection: - printf("RR_UnknownConnection"); + output(0, "RR_UnknownConnection"); return; default: - printf("%d", connection); + output(0, "%d", connection); } } @@ -847,14 +915,15 @@ XRRScreenChangeNotifyEvent *e = (XRRScreenChangeNotifyEvent *) eventp; XRRUpdateConfiguration(eventp); - printf(" root 0x%lx, timestamp %lu, config_timestamp %lu\n", + output(Indent | NewLine, "root 0x%lx, timestamp %lu, config_timestamp %lu", e->root, e->timestamp, e->config_timestamp); - printf(" size_index %hu", e->size_index); - printf(", subpixel_order "); + output(Indent, "size_index %hu", e->size_index); + output(0, ", subpixel_order "); print_SubPixelOrder(e->subpixel_order); - printf("\n rotation "); + output(InitialNewLine | Indent, "rotation "); print_Rotation(e->rotation); - printf("\n width %d, height %d, mwidth %d, mheight %d\n", + output(InitialNewLine | Indent | NewLine, + "width %d, height %d, mwidth %d, mheight %d", e->width, e->height, e->mwidth, e->mheight); } @@ -875,29 +944,29 @@ break; } } - printf(" subtype XRROutputChangeNotifyEvent\n"); + output(Indent | NewLine, "subtype XRROutputChangeNotifyEvent"); if (output_info) - printf(" output %s, ", output_info->name); + output(Indent, "output %s, ", output_info->name); else - printf(" output %lu, ", e->output); + output(Indent, "output %lu, ", e->output); if (e->crtc) - printf("crtc %lu, ", e->crtc); + output(0, "crtc %lu, ", e->crtc); else - printf("crtc None, "); + output(0, "crtc None, "); if (mode_info) - printf("mode %s (%dx%d)\n", mode_info->name, mode_info->width, + output(NewLine, "mode %s (%dx%d)", mode_info->name, mode_info->width, mode_info->height); else if (e->mode) - printf("mode %lu\n", e->mode); + output(NewLine, "mode %lu", e->mode); else - printf("mode None\n"); - printf(" rotation "); + output(NewLine, "mode None"); + output(Indent, "rotation "); print_Rotation(e->rotation); - printf("\n connection "); + output(InitialNewLine | Indent, "connection "); print_Connection(e->connection); - printf(", subpixel_order "); + output(0, ", subpixel_order "); print_SubPixelOrder(e->subpixel_order); - printf("\n"); + output_new_line(); XRRFreeOutputInfo(output_info); } @@ -916,20 +985,20 @@ break; } } - printf(" subtype XRRCrtcChangeNotifyEvent\n"); + output(Indent | NewLine, "subtype XRRCrtcChangeNotifyEvent"); if (e->crtc) - printf(" crtc %lu, ", e->crtc); + output(Indent, "crtc %lu, ", e->crtc); else - printf(" crtc None, "); + output(Indent, "crtc None, "); if (mode_info) - printf("mode %s, ", mode_info->name); + output(0, "mode %s, ", mode_info->name); else if (e->mode) - printf("mode %lu, ", e->mode); + output(0, "mode %lu, ", e->mode); else - printf("mode None, "); - printf("rotation "); + output(0, "mode None, "); + output(0, "rotation "); print_Rotation(e->rotation); - printf("\n x %d, y %d, width %d, height %d\n", + output(InitialNewLine | Indent | NewLine, "x %d, y %d, width %d, height %d", e->x, e->y, e->width, e->height); } @@ -943,18 +1012,18 @@ if (screen_resources) output_info = XRRGetOutputInfo(dpy, screen_resources, e->output); - printf(" subtype XRROutputPropertyChangeNotifyEvent\n"); + output(Indent | NewLine, "subtype XRROutputPropertyChangeNotifyEvent"); if (output_info) - printf(" output %s, ", output_info->name); + output(Indent, "output %s, ", output_info->name); else - printf(" output %lu, ", e->output); - printf("property %s, timestamp %lu, state ", property, e->timestamp); + output(Indent, "output %lu, ", e->output); + output(0, "property %s, timestamp %lu, state ", property, e->timestamp); if (e->state == PropertyNewValue) - printf("NewValue\n"); + output(NewLine, "NewValue"); else if (e->state == PropertyDelete) - printf("Delete\n"); + output(NewLine, "Delete"); else - printf("%d\n", e->state); + output(NewLine, "%d", e->state); XRRFreeOutputInfo(output_info); XFree(property); } @@ -979,7 +1048,7 @@ do_RRNotify_OutputProperty(eventp, screen_resources); break; default: - printf(" subtype %d\n", e->subtype); + output(Indent | NewLine, "subtype %d", e->subtype); } XRRFreeScreenResources(screen_resources); } @@ -1054,6 +1123,7 @@ " owner_grab_button randr button\n" " This option can be specified multiple times to select multiple\n" " event masks.\n" +" -1 display only a single line per event\n" " -version print version and exit\n" "\n"; @@ -1256,6 +1326,9 @@ usage(NULL); event_mask_specified = True; continue; + case '1': + single_line = True; + continue; case 'v': puts(PACKAGE_STRING); exit(0); @@ -1550,9 +1623,12 @@ break; } } - printf("Unknown event type %d\n", event.type); + output(NewLine, "Unknown event type %d", event.type); break; } + if (single_line) { + printf("\n"); + } fflush(stdout); } ++++++ xev.keyring ++++++ ++++ 912 lines (skipped) ++++ between xev.keyring ++++ and /work/SRC/openSUSE:Factory/.xev.new.3592/xev.keyring
