diff -Nru gromit-mpx-1.2/AUTHORS gromit-mpx-1.3/AUTHORS --- gromit-mpx-1.2/AUTHORS 2016-11-16 21:44:50.000000000 +0000 +++ gromit-mpx-1.3/AUTHORS 2018-12-28 15:39:41.000000000 +0000 @@ -1,2 +1,13 @@ Simon Budig Christian Beier +Barak A. Pearlmutter +Nathan Whitehead +Lukáš Hermann +Katie Holly +Monty Montgomery +AlisterH +Mehmet Atif Ergun +Russel Winder +Tao Klerks +Tobias Schönberg +Yuri D'Elia diff -Nru gromit-mpx-1.2/build-config.h_cmake_in gromit-mpx-1.3/build-config.h_cmake_in --- gromit-mpx-1.2/build-config.h_cmake_in 2016-11-16 21:44:50.000000000 +0000 +++ gromit-mpx-1.3/build-config.h_cmake_in 2018-12-28 15:39:41.000000000 +0000 @@ -1,4 +1,4 @@ -#ifndef BUILD_CONFIG_h +#ifndef BUILD_CONFIG_H #define BUILD_CONFIG_H /* Name of package */ diff -Nru gromit-mpx-1.2/ChangeLog gromit-mpx-1.3/ChangeLog --- gromit-mpx-1.2/ChangeLog 2016-11-16 21:44:50.000000000 +0000 +++ gromit-mpx-1.3/ChangeLog 2018-12-28 15:39:41.000000000 +0000 @@ -1,3 +1,307 @@ +commit b4ed990916d40c2c418d5e12f43672a8b2ddead8 +Author: Christian Beier +Date: Fri Dec 28 16:37:58 2018 +0100 + + Update TODO + +commit 4bcaee501994817355eb4a87510dd6f072a592aa +Author: Christian Beier +Date: Fri Dec 28 16:30:28 2018 +0100 + + Update NEWS + +commit 05341fa4d17eb4c5a9eb63a5e04ddcc69992fec8 +Author: Christian Beier +Date: Fri Dec 28 16:16:04 2018 +0100 + + Update AUTHORS + +commit 718738752aa14efa172a57a618cba5c81caf77bc +Merge: a185c56 c5506dd +Author: Christian Beier +Date: Fri Dec 28 15:44:39 2018 +0100 + + Merge branch 'fix-slavehandling' + +commit c5506dd1025771bc23ee9f5855a52cf06f3e26c5 +Author: Christian Beier +Date: Fri Dec 28 15:42:07 2018 +0100 + + Allow configuration of slave devices, too + + This is a rework of 58bdef4d49ab4269fedda55e825ce8ad8a62076c. + +commit a185c564fd94759190d6c9363c5a66b04abfd7a7 +Author: Christian Beier +Date: Sun Dec 2 23:22:12 2018 +0100 + + README: fix issues pointed out by markdownlint + +commit 032d46f5e3a20d428c5a071178ae4f328e429454 +Author: Christian Beier +Date: Sun Dec 2 23:03:30 2018 +0100 + + CMake: fix build-config.h template header guard + +commit 2b21482e16a010f026d1a81d822b8876429584fa +Author: Christian Beier +Date: Sun Dec 2 22:41:34 2018 +0100 + + Add stdint.h to define intptr_t on all compilers + +commit 53062c7427983d5f2c6669ecc127bf8870ceccdb +Author: Christian Beier +Date: Mon Nov 26 22:11:15 2018 +0100 + + Remove proximity event handling + + It is not supported in XInput2. + +commit b16c685e6b1ad9787481c93d1ef7516c8392c255 +Author: Christian Beier +Date: Mon Nov 26 13:10:51 2018 +0100 + + Remove last slave handling remnants + +commit cc3c090a96c91d758299cfafdfecd361450c9dd2 +Author: Christian Beier +Date: Mon Nov 26 12:42:30 2018 +0100 + + Revert "Add reasonably complete support for slave devices." + + This reverts commit 58bdef4d49ab4269fedda55e825ce8ad8a62076c. + + Closes #29 + +commit bd47b373fedd6aecf066644a08c8eb68247a9e40 +Author: Christian Beier +Date: Mon Nov 26 12:12:54 2018 +0100 + + Revert "Only grab master devices." + + This reverts commit 335ff721b4416a4d5cd03a987f81716101e03540. + +commit 017c4f4b5d033e6686e99a8e57fd220d6da2f93b +Author: Christian Beier +Date: Mon Nov 19 17:10:48 2018 +0100 + + README: fix typo + +commit a751b83a303a865fa5dc157e9f40b05c92c4f58d +Author: Christian Beier +Date: Mon Nov 19 11:10:02 2018 +0100 + + README: fix linking + +commit 080282e14b5235bd9176636b68d9f01b32777cdb +Author: Christian Beier +Date: Mon Nov 19 11:07:11 2018 +0100 + + README: add instructions on how to setup MPX + + Closes #59 + +commit c451f01410b30827d317be0856ba4be614359142 +Author: Christian Beier +Date: Mon Nov 19 10:22:34 2018 +0100 + + README: move the 'Configuration' section into 'How to use' + +commit 2f7ca97200b14bdaed8c5d7e47212e5d6e9bc929 +Author: Christian Beier +Date: Mon Nov 19 10:11:11 2018 +0100 + + README: fix headings + +commit ee6815e458eb1710e703ed41b3f097501099023b +Author: Christian Beier +Date: Sun Nov 4 17:53:57 2018 +0100 + + config: use pre glib-2.44 style + +commit 1eef4b5d27648d88926ad3932f135ea75f8ebab8 +Author: Christian Beier +Date: Sun Nov 4 16:22:46 2018 +0100 + + Add an introduction screen + + This replaces the old poor-man's help screen and hopefully serves its + purpose of telling users about the hotkeys better. + + In the wake of adding this, Gromit-MPX also received a basic config + system based on GKeyFile, which some day might replace the handwritten + config parser we rely on now. + + GKeyFile was not there when Simon started the original Gromit (it + appeared around 2004), so he had to resort to GScanner. + + Closes #56 + +commit d96106f9a30b2bc377a5f9a1c3d95f3dcbf37719 +Author: Christian Beier +Date: Sat Nov 3 16:28:00 2018 +0100 + + README: fix typo + +commit f3ddd27ab65787d4afbc40ce40ff716d293a1fdb +Author: Christian Beier +Date: Sat Nov 3 13:21:32 2018 +0100 + + CMake: add xpms to sources + +commit 07e3dd3d322032f86047889b38fc793b7cb77ca2 +Author: Christian Beier +Date: Sat Nov 3 13:10:30 2018 +0100 + + Remove the now-obsolete help menu entry + +commit 487a6e3035b57b02421a4c1a9bb180a072500514 +Author: Christian Beier +Date: Sat Nov 3 12:55:09 2018 +0100 + + Update man page date + +commit a7122e4cdea2ba7e238202f6ebb25b0fadefeb18 +Author: Christian Beier +Date: Sat Nov 3 12:52:39 2018 +0100 + + Order options in manpage alphabetically + +commit 0022af97aec57f6db0cf1f8ddb49e0537f083697 +Author: Christian Beier +Date: Sat Nov 3 12:49:28 2018 +0100 + + Add opacity-setting to man page + + Closes #54 + +commit 2c8dd6391e733723a93098bdcfcb3ef9d13c478a +Author: Christian Beier +Date: Sat Nov 3 12:46:47 2018 +0100 + + Make the opacity error message locale-independent + +commit 4c2eb4f3eb7a519fbe62f5fde6a9d399b03308d1 +Author: Christian Beier +Date: Sat Nov 3 12:29:18 2018 +0100 + + Directly show hotkeys in the menu + + re #42 #56 + +commit a4103b2fa1c40965df2f219d126b0a9596689a3f +Author: Christian Beier +Date: Mon Oct 29 13:16:47 2018 +0100 + + Add screen size values to on-change debug log + + re #55 + +commit 40f928f1bcfdc1e47aa6d8ee2eb29f5551c231c1 +Author: Christian Beier +Date: Sun Oct 28 22:53:35 2018 +0100 + + Update copyright year + +commit 3f85689b9fe3e371873643c2a8fd9d5605b8738f +Author: Christian Beier +Date: Sun Mar 18 15:28:19 2018 +0100 + + Make select_tool debug logs a bit clearer + +commit 73caad9023dbeb1037830f2d0d3984aad723aefc +Author: Christian Beier +Date: Sun Mar 18 15:07:20 2018 +0100 + + Prefix select_tool debug logs + +commit 6cc126bf4a4a5608d02aaeb488583bfaaa849aa2 +Author: Christian Beier +Date: Thu Mar 8 01:56:43 2018 +0100 + + README: add a note about maybe-missing sys tray + + Closes #47. + +commit df4194b332dbfad5eb6341b9f8a19b32b47a489c +Merge: 295a34b 5ce93ee +Author: Christian Beier +Date: Sun Feb 25 18:12:58 2018 +0100 + + Merge pull request #48 from Fusl/master + + Allow not grabbing undo-key + +commit 5ce93ee0e32950f6fdfc7ddd391e8820ef7b9e5d +Author: Katie Holly +Date: Wed Feb 14 03:09:28 2018 +0100 + + Adding `build/` directory to .gitignore (documented in README.md) + + Signed-off-by: Katie Holly + +commit b67083b32d077e0bd4e0b623adc515230acc9880 +Author: Katie Holly +Date: Wed Feb 14 03:08:31 2018 +0100 + + Allow unbinding undo-key + + Signed-off-by: Katie Holly + +commit 295a34b164788d8826892bd108eb2edfc90cc204 +Merge: 218e75a d627d3c +Author: Christian Beier +Date: Sun Dec 4 18:07:01 2016 +0100 + + Merge pull request #39 from barak/upstream + + add ENVIRONMENT and FILES man page sections + +commit d627d3c05e432750fcf0e4ec540ee4f3ab97be87 +Author: Barak A. Pearlmutter +Date: Sun Dec 4 17:12:38 2016 +0100 + + add ENVIRONMENT and FILES man page sections + +commit 218e75a593f5268a244f1e50a750d9b3486b4863 +Merge: ad169c9 cfc916f +Author: Christian Beier +Date: Sun Nov 20 12:35:57 2016 +0100 + + Merge pull request #36 from barak/tweaks + + cmake installation dirs + +commit cfc916f63803e3a8e1dde7a35c5fc5191d7711eb +Author: Barak A. Pearlmutter +Date: Sat Nov 19 15:19:28 2016 +0000 + + cmake installation dirs + +commit ad169c97034fecc9768cbec9033fad7c65ba7e03 +Author: Christian Beier +Date: Fri Nov 18 19:37:59 2016 +0100 + + Next version will be 1.3. + +commit a11478c3bdbc26e443a7cd4ab8d0f9e1f0683481 +Author: Christian Beier +Date: Fri Nov 18 19:36:39 2016 +0100 + + Remove Autotools, CMake now is the only build system. + +commit eba556e20bc1b3abc556d8c73ff12beeb838b839 +Author: Christian Beier +Date: Fri Nov 18 14:31:40 2016 +0100 + + TravisCI: swtich to cmake as default build system + +commit a835decff6d0186bd96075bca8ed31144f2ff9e2 +Author: Christian Beier +Date: Wed Nov 16 22:44:50 2016 +0100 + + Update ChangeLog. + commit c2b4d4a044edea046494e6c628c01ea26e8246a5 Author: Christian Beier Date: Wed Nov 16 22:34:09 2016 +0100 @@ -1277,7 +1581,7 @@ Merge branch 'master' of github.com:bk138/gromit-mpx Resolved conflicts: - TODO + TODO commit 376e0d6179635ced4c8d9724727d6d8764984f94 Author: Christian Beier diff -Nru gromit-mpx-1.2/CMakeLists.txt gromit-mpx-1.3/CMakeLists.txt --- gromit-mpx-1.2/CMakeLists.txt 2016-11-16 21:44:50.000000000 +0000 +++ gromit-mpx-1.3/CMakeLists.txt 2018-12-28 15:39:41.000000000 +0000 @@ -1,8 +1,8 @@ cmake_minimum_required(VERSION 3.0) -project(Gromit_MPX LANGUAGES C) +project(gromit-mpx LANGUAGES C) set(target_name gromit-mpx) -set(version 1.2) +set(version 1.3) set(CMAKE_C_FLAGS " ${CMAKE_C_FLAGS} -Wall -Wextra -Wno-unused-parameter") @@ -39,6 +39,8 @@ src/gromit-mpx.h src/input.c src/input.h + src/paint_cursor.xpm + src/erase_cursor.xpm ) add_executable(${target_name} ${sources}) @@ -51,13 +53,15 @@ -lm ) -install(TARGETS ${target_name} RUNTIME DESTINATION bin) -install(FILES data/gromit-mpx.desktop DESTINATION share/applications) -install(FILES data/gromit-mpx.cfg DESTINATION etc/gromit-mpx) -install(FILES README.md AUTHORS ChangeLog NEWS DESTINATION share/doc/gromit-mpx) -install(FILES gromit-mpx.1 DESTINATION share/man/man1) -install(FILES data/gromit-mpx.png data/gromit-mpx.xpm DESTINATION share/pixmaps) -install(FILES data/gromit-mpx.svg DESTINATION share/icons/hicolor/scalable/apps) +include(GNUInstallDirs) + +install(TARGETS ${target_name} RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}) +install(FILES data/gromit-mpx.desktop DESTINATION ${CMAKE_INSTALL_DATADIR}/applications) +install(FILES data/gromit-mpx.cfg DESTINATION ${CMAKE_INSTALL_SYSCONFDIR}/gromit-mpx) +install(FILES README.md AUTHORS ChangeLog NEWS DESTINATION ${CMAKE_INSTALL_DOCDIR}) +install(FILES gromit-mpx.1 DESTINATION ${CMAKE_INSTALL_MANDIR}/man1) +install(FILES data/gromit-mpx.png data/gromit-mpx.xpm DESTINATION ${CMAKE_INSTALL_DATADIR}/pixmaps) +install(FILES data/gromit-mpx.svg DESTINATION ${CMAKE_INSTALL_DATADIR}/icons/hicolor/scalable/apps) configure_file( "${CMAKE_CURRENT_SOURCE_DIR}/cmake_uninstall.cmake.in" diff -Nru gromit-mpx-1.2/configure.ac gromit-mpx-1.3/configure.ac --- gromit-mpx-1.2/configure.ac 2016-11-16 21:44:50.000000000 +0000 +++ gromit-mpx-1.3/configure.ac 1970-01-01 00:00:00.000000000 +0000 @@ -1,34 +0,0 @@ -# Process this file with autoconf to produce a configure script. - -AC_PREREQ([2.69]) -AC_INIT([gromit-mpx],[1.2],[Christian Beier ],[gromit-mpx],[https://github.com/bk138/gromit-mpx]) -AM_INIT_AUTOMAKE([foreign subdir-objects -Wall]) -AC_CONFIG_SRCDIR([src/gromit-mpx.c]) -AC_CONFIG_HEADERS([build-config.h]) - -# Checks for programs. -AC_PROG_CC -AM_PROG_CC_C_O -AX_CFLAGS_WARN_ALL -AC_HEADER_STDC -PKG_PROG_PKG_CONFIG([0.20]) - -# Checks for libraries. -# check for math -AC_SEARCH_LIBS([atan2], [m]) -# check for gtk -PKG_CHECK_MODULES([GTK3], [gtk+-3.0 >= 2.99.3]) -# libappindicator for tray icon -PKG_CHECK_MODULES([APPINDICATOR], appindicator3-0.1 >= 0.4.92) -# check for XInput -PKG_CHECK_MODULES([XINPUT2], [xi >= 1.3]) -# check for X -PKG_CHECK_MODULES([X11], [x11]) -# export linker flags in the right order -LIBS="$GTK3_LIBS $APPINDICATOR_LIBS $XINPUT2_LIBS $X11_LIBS $LIBS" - -# *************************************************************************** -# finally -# *************************************************************************** -AC_CONFIG_FILES([Makefile src/Makefile]) -AC_OUTPUT diff -Nru gromit-mpx-1.2/debian/changelog gromit-mpx-1.3/debian/changelog --- gromit-mpx-1.2/debian/changelog 2016-12-04 14:36:14.000000000 +0000 +++ gromit-mpx-1.3/debian/changelog 2018-12-30 21:09:40.000000000 +0000 @@ -1,3 +1,17 @@ +gromit-mpx (1.3-1) unstable; urgency=medium + + [ Ondřej Nový ] + * d/copyright: Use https protocol in Format field + * d/changelog: Remove trailing whitespaces + * d/control: Remove trailing whitespaces + + [ Barak A. Pearlmutter ] + * New upstream release + * bump to debhelper 11 + * bump policy, no changes required + + -- Barak A. Pearlmutter Sun, 30 Dec 2018 21:09:40 +0000 + gromit-mpx (1.2-2) unstable; urgency=medium * Track upstream development @@ -32,6 +46,6 @@ gromit-mpx (1.1-1) unstable; urgency=low - * Initial release + * Initial release -- Barak A. Pearlmutter Tue, 20 Aug 2013 00:53:30 +0200 diff -Nru gromit-mpx-1.2/debian/compat gromit-mpx-1.3/debian/compat --- gromit-mpx-1.2/debian/compat 2016-12-04 14:36:14.000000000 +0000 +++ gromit-mpx-1.3/debian/compat 2018-12-30 21:09:40.000000000 +0000 @@ -1 +1 @@ -10 +11 diff -Nru gromit-mpx-1.2/debian/control gromit-mpx-1.3/debian/control --- gromit-mpx-1.2/debian/control 2016-12-04 14:36:14.000000000 +0000 +++ gromit-mpx-1.3/debian/control 2018-12-30 21:09:40.000000000 +0000 @@ -2,20 +2,20 @@ Section: x11 Priority: optional Maintainer: Barak A. Pearlmutter -Build-Depends: debhelper (>= 10), +Build-Depends: debhelper (>= 11), cmake, libgtk-3-dev, libappindicator3-dev -Standards-Version: 3.9.8 +Standards-Version: 4.3.0 Homepage: https://github.com/bk138/gromit-mpx -Vcs-Git: git://anonscm.debian.org/collab-maint/gromit-mpx.git -Vcs-Browser: http://anonscm.debian.org/gitweb/?p=collab-maint/gromit-mpx.git +Vcs-Git: https://salsa.debian.org/debian/gromit-mpx.git +Vcs-Browser: https://salsa.debian.org/debian/gromit-mpx Package: gromit-mpx Architecture: any Depends: ${shlibs:Depends}, ${misc:Depends} Description: GTK+ based tool to make annotations on screen with multiple pointers - Gromit-MPX enables you to make annotations on your screen using + Gromit-MPX enables you to make annotations on your screen using multiple pointing devices at once. . This is especially useful when making presentations, to highlight diff -Nru gromit-mpx-1.2/debian/copyright gromit-mpx-1.3/debian/copyright --- gromit-mpx-1.2/debian/copyright 2016-12-04 14:36:14.000000000 +0000 +++ gromit-mpx-1.3/debian/copyright 2018-12-30 15:56:29.000000000 +0000 @@ -1,4 +1,4 @@ -Format: http://www.debian.org/doc/packaging-manuals/copyright-format/1.0/ +Format: https://www.debian.org/doc/packaging-manuals/copyright-format/1.0/ Upstream-Name: gromit-mpx Upstream-Contact: Christian Beier Source: https://github.com/bk138/gromit-mpx diff -Nru gromit-mpx-1.2/debian/patches/debian-changes gromit-mpx-1.3/debian/patches/debian-changes --- gromit-mpx-1.2/debian/patches/debian-changes 2016-12-04 14:36:14.000000000 +0000 +++ gromit-mpx-1.3/debian/patches/debian-changes 1970-01-01 00:00:00.000000000 +0000 @@ -1,133 +0,0 @@ -Description: - TODO: Put a short summary on the line above and replace this paragraph - with a longer explanation of this change. Complete the meta-information - with other relevant fields (see below for details). To make it easier, the - information below has been extracted from the changelog. Adjust it or drop - it. - . - gromit-mpx (1.2-2) unstable; urgency=medium - . - * Track upstream development - * Remove debian default hotkey patch (PAUSE) reverting to upstream (F9) - * Remove now-unnecessary dh build system option -Author: Barak A. Pearlmutter - ---- -The information above should follow the Patch Tagging Guidelines, please -checkout http://dep.debian.net/deps/dep3/ to learn about the format. Here -are templates for supplementary fields that you might want to add: - -Origin: , -Bug: -Bug-Debian: https://bugs.debian.org/ -Bug-Ubuntu: https://launchpad.net/bugs/ -Forwarded: -Reviewed-By: -Last-Update: 2017-01-19 - ---- gromit-mpx-1.2.orig/.travis.yml -+++ gromit-mpx-1.2/.travis.yml -@@ -4,10 +4,10 @@ sudo: required - - # install build dependencies - before_install: -- - sudo apt-get install automake libgtk-3-dev libappindicator3-dev libxi-dev -+ - sudo apt-get install cmake libgtk-3-dev libappindicator3-dev libxi-dev - --# before build script, run autoreconf --before_script: autoreconf -fiv -- --# Default is "./configure && make && make test", but no tests yet --script: "./configure && make" -\ No newline at end of file -+# Build steps -+script: -+ - mkdir build -+ - cd build -+ - cmake .. && make ---- gromit-mpx-1.2.orig/CMakeLists.txt -+++ gromit-mpx-1.2/CMakeLists.txt -@@ -1,8 +1,8 @@ - cmake_minimum_required(VERSION 3.0) --project(Gromit_MPX LANGUAGES C) -+project(gromit-mpx LANGUAGES C) - - set(target_name gromit-mpx) --set(version 1.2) -+set(version 1.3) - - set(CMAKE_C_FLAGS " ${CMAKE_C_FLAGS} -Wall -Wextra -Wno-unused-parameter") - -@@ -51,13 +51,15 @@ target_link_libraries(${target_name} - -lm - ) - --install(TARGETS ${target_name} RUNTIME DESTINATION bin) --install(FILES data/gromit-mpx.desktop DESTINATION share/applications) --install(FILES data/gromit-mpx.cfg DESTINATION etc/gromit-mpx) --install(FILES README.md AUTHORS ChangeLog NEWS DESTINATION share/doc/gromit-mpx) --install(FILES gromit-mpx.1 DESTINATION share/man/man1) --install(FILES data/gromit-mpx.png data/gromit-mpx.xpm DESTINATION share/pixmaps) --install(FILES data/gromit-mpx.svg DESTINATION share/icons/hicolor/scalable/apps) -+include(GNUInstallDirs) -+ -+install(TARGETS ${target_name} RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}) -+install(FILES data/gromit-mpx.desktop DESTINATION ${CMAKE_INSTALL_DATADIR}/applications) -+install(FILES data/gromit-mpx.cfg DESTINATION ${CMAKE_INSTALL_SYSCONFDIR}/gromit-mpx) -+install(FILES README.md AUTHORS ChangeLog NEWS DESTINATION ${CMAKE_INSTALL_DOCDIR}) -+install(FILES gromit-mpx.1 DESTINATION ${CMAKE_INSTALL_MANDIR}/man1) -+install(FILES data/gromit-mpx.png data/gromit-mpx.xpm DESTINATION ${CMAKE_INSTALL_DATADIR}/pixmaps) -+install(FILES data/gromit-mpx.svg DESTINATION ${CMAKE_INSTALL_DATADIR}/icons/hicolor/scalable/apps) - - configure_file( - "${CMAKE_CURRENT_SOURCE_DIR}/cmake_uninstall.cmake.in" ---- gromit-mpx-1.2.orig/README.md -+++ gromit-mpx-1.2/README.md -@@ -95,13 +95,15 @@ will undo the last two strokes. The maxi - - ### Building it - --Gromit-MPX is small and lightweight. It needs GTK+3 to build. --Simply type `./configure && make && make install`. -+Gromit-MPX uses CMake as its build system. Thus, it's the usual: - --If you checked out from git instead of using the tarball, an --`autoreconf --install` is needed to setup the build system. -+ mkdir build -+ cd build -+ cmake .. -+ make -+ -+from the root of the source tree. - --You might also need to install `automake` and `gtk3-devel`. - - ### Configuration: - ---- gromit-mpx-1.2.orig/gromit-mpx.1 -+++ gromit-mpx-1.2/gromit-mpx.1 -@@ -103,6 +103,24 @@ will undo the last drawing stroke. - .TP - .B \-y, \-\-redo - will redo the last undone drawing stroke. -+.SH ENVIRONMENT -+.TP -+.B GDK_BACKEND -+Set to force use of a particular backend, valid values are -+.I x11 -+or -+.IR wayland . -+.TP -+.B XDG_CONFIG_HOME -+Directory to search for user's custom configuration file, defaults to -+.BI ~ /.config/ . -+.SH FILES -+.TP -+.I gromit\-mpx.cfg -+Configuration file which defines pens and maps mouse buttons and -+modifiers to them. Searched for in user's custom configuration file -+directory and, if not found there, in -+.IR /etc/gromit\-mpx/ . - .SH BUGS - When there is no compositing manager such as Compiz, xcompmgr or Mutter - running, Gromit-MPX falls back to a legacy drawing mode. This may diff -Nru gromit-mpx-1.2/debian/patches/series gromit-mpx-1.3/debian/patches/series --- gromit-mpx-1.2/debian/patches/series 2016-12-04 14:36:14.000000000 +0000 +++ gromit-mpx-1.3/debian/patches/series 1970-01-01 00:00:00.000000000 +0000 @@ -1 +0,0 @@ -debian-changes diff -Nru gromit-mpx-1.2/.gitignore gromit-mpx-1.3/.gitignore --- gromit-mpx-1.2/.gitignore 2016-11-16 21:44:50.000000000 +0000 +++ gromit-mpx-1.3/.gitignore 2018-12-28 15:39:41.000000000 +0000 @@ -20,6 +20,7 @@ /.idea/ /Build/ +/build/ /cmake-build-debug/ *~ /Build_Release/ diff -Nru gromit-mpx-1.2/gromit-mpx.1 gromit-mpx-1.3/gromit-mpx.1 --- gromit-mpx-1.2/gromit-mpx.1 2016-11-16 21:44:50.000000000 +0000 +++ gromit-mpx-1.3/gromit-mpx.1 2018-12-28 15:39:41.000000000 +0000 @@ -1,5 +1,5 @@ .\" Hey, vim: ft=nroff -.TH GROMIT-MPX 1 "November 16, 2016" +.TH GROMIT-MPX 1 "November 3, 2018" .\" Please adjust this date whenever revising the manpage. .\" .\" Some roff macros, for reference: @@ -56,6 +56,9 @@ .B \-a, \-\-active start Gromit-MPX and immediately activate it. .TP +.B \-d, \-\-debug +gives some debug output. +.TP .B \-k , \-\-key will change the key used to grab the mouse. can e.g. be "F9", "F12", "Control_R" or "Print". To determine the keysym for @@ -68,6 +71,9 @@ to specify the key uniquely. To determine the keycode for different keys you can use the \fBxev\fP(1) command. .TP +.B \-o, \-\-opacity +will set the initial opacity of the window using a floating point value between 0 and 1. +.TP .B \-u , \-\-undo\-key will change the key used to undo/redo strokes. can e.g. be "F9", "F12", "Control_R" or "Print". To determine the keysym for @@ -79,13 +85,13 @@ identifying the key with the keysym can fail. You can then use the keycode to specify the key uniquely. To determine the keycode for different keys you can use the \fBxev\fP(1) command. -.TP -.B \-d, \-\-debug -gives some debug output. .SH OPTIONS (CONTROL) A sort summary of the available commandline arguments to control an already running Gromit-MPX process, see above for the options available to start Gromit-MPX. .TP +.B \-c, \-\-clear +will clear the screen. +.TP .B \-q, \-\-quit will cause the main Gromit-MPX process to quit. .TP @@ -95,14 +101,29 @@ .B \-v, \-\-visibility will toggle the visibility of the window. .TP -.B \-c, \-\-clear -will clear the screen. +.B \-y, \-\-redo +will redo the last undone drawing stroke. .TP .B \-z, \-\-undo will undo the last drawing stroke. +.SH ENVIRONMENT .TP -.B \-y, \-\-redo -will redo the last undone drawing stroke. +.B GDK_BACKEND +Set to force use of a particular backend, valid values are +.I x11 +or +.IR wayland . +.TP +.B XDG_CONFIG_HOME +Directory to search for user's custom configuration file, defaults to +.BI ~ /.config/ . +.SH FILES +.TP +.I gromit\-mpx.cfg +Configuration file which defines pens and maps mouse buttons and +modifiers to them. Searched for in user's custom configuration file +directory and, if not found there, in +.IR /etc/gromit\-mpx/ . .SH BUGS When there is no compositing manager such as Compiz, xcompmgr or Mutter running, Gromit-MPX falls back to a legacy drawing mode. This may diff -Nru gromit-mpx-1.2/Makefile.am gromit-mpx-1.3/Makefile.am --- gromit-mpx-1.2/Makefile.am 2016-11-16 21:44:50.000000000 +0000 +++ gromit-mpx-1.3/Makefile.am 1970-01-01 00:00:00.000000000 +0000 @@ -1,30 +0,0 @@ -## Process this file with automake to produce Makefile.in - -SUBDIRS = src - -doc_DATA = \ - README.md\ - AUTHORS\ - ChangeLog\ - NEWS - -Applicationsdir = $(datadir)/applications/ -Applications_DATA = data/gromit-mpx.desktop - -pixmapdir = $(datadir)/pixmaps -pixmap_DATA = data/gromit-mpx.png \ - data/gromit-mpx.xpm - -man_MANS = gromit-mpx.1 - -scalabledir = $(datadir)/icons/hicolor/scalable/apps -scalable_DATA = data/gromit-mpx.svg - -configdir = $(sysconfdir)/gromit-mpx -config_DATA = data/gromit-mpx.cfg - -EXTRA_DIST = $(doc_DATA) \ - $(Applications_DATA) \ - $(pixmap_DATA) \ - $(config_DATA) \ - COPYING diff -Nru gromit-mpx-1.2/NEWS gromit-mpx-1.3/NEWS --- gromit-mpx-1.2/NEWS 2016-11-16 21:44:50.000000000 +0000 +++ gromit-mpx-1.3/NEWS 2018-12-28 15:39:41.000000000 +0000 @@ -1,3 +1,10 @@ +Gromit-MPX 1.3 + * Gromit-MPX now shows the hotkeys bound to some functionality directly in the menu. + * Replaced the help menu with an introduction to Gromit-MPX that shows on startup. + * Reworked slave device handling so that per-slave configuration is now done The Right + Way™. + * Build system switched to CMake, removed Autotools. + Gromit-MPX 1.2 * Added undo/redo functionality thanks to Nathan Whitehead. diff -Nru gromit-mpx-1.2/README.md gromit-mpx-1.3/README.md --- gromit-mpx-1.2/README.md 2016-11-16 21:44:50.000000000 +0000 +++ gromit-mpx-1.3/README.md 2018-12-28 15:39:41.000000000 +0000 @@ -1,6 +1,6 @@ -[![Build Status](https://travis-ci.org/bk138/gromit-mpx.svg?branch=master)](https://travis-ci.org/bk138/gromit-mpx) +# Gromit-MPX -## Gromit-MPX +[![Build Status](https://travis-ci.org/bk138/gromit-mpx.svg?branch=master)](https://travis-ci.org/bk138/gromit-mpx) Gromit-MPX is a multi-pointer port of the original [Gromit annotation tool](http://www.home.unix-ag.org/simon/gromit) by [Simon @@ -11,9 +11,7 @@ available. Also, it does not inhibit Drag-and-Drop like the original Gromit tool. - - -### What is it? +## What it is Gromit-MPX (GRaphics Over MIscellaneous Things) is a small tool to make annotations on the screen. @@ -23,19 +21,17 @@ interest until hopefully everybody noticed it. With Gromit-MPX, you can draw everywhere onto the screen, highlighting some button or area. - Similar tools for MS-Windows include *DemoHelper* (GPLv2 also), or proprietary tools like *ZoomIt* and *ScreenMarker*. For Compiz, there is also the *Annotate* plugin, and the much-flashier *Firepaint (paint fire on screen)* plugin. +## How to use it -### How to use it - -You can operate Gromit-MPX using its tray icon, but since you -typically want to use the program you are demonstrating and -highlighting something is a short interruption of your workflow, -Gromit-MPX can be toggled on and off on the fly via a hotkey: +You can operate Gromit-MPX using its tray icon (if your desktop environment +provides a sys tray), but since you typically want to use the program you +are demonstrating and highlighting something is a short interruption of +your workflow, Gromit-MPX can be toggled on and off on the fly via a hotkey: Per default, it grabs the `F9` and `F10` keys, so that no other application can use them and they are available to Gromit-MPX only. The available @@ -44,21 +40,20 @@ F9: toggle painting SHIFT-F9: clear screen CTRL-F9: toggle visibility - ALT-F9: Quit Gromit-MPX. + ALT-F9: quit Gromit-MPX F10: undo last stroke SHIFT-F10: redo last undone stroke You can specify the keys to grab via: -``` -gromit-mpx --key --undo-key -``` + + gromit-mpx --key --undo-key + Specifying an empty string or `none` for the keysym will prevent gromit from grabbing a key. You can specify the opacity simply via: -``` -gromit-mpx -o -``` + + gromit-mpx -o Alternatively you can invoke Gromit-MPX with various arguments to control an already running Gromit-MPX . @@ -92,18 +87,27 @@ Undo/redo commands are cumulative. For example, sending two undo commands will undo the last two strokes. The maximum undo/redo depth is 4 strokes. +### Setting up multi-pointer + +As its name implies, Gromit-MPX relies on Multi-Pointer-X functionality +provided by the XInput2 extension. -### Building it +You can create a simple MPX setup via the `xinput` utility: -Gromit-MPX is small and lightweight. It needs GTK+3 to build. -Simply type `./configure && make && make install`. + xinput --create-master two # create a second input focus (master) + xinput --list # see your master and slave devices and ids + xinput --reattach # reattach slave -If you checked out from git instead of using the tarball, an -`autoreconf --install` is needed to setup the build system. +If you attach a keyboard slave device to the newly created second master, +its hotkey will activate annotation mode for the associated pointer only. +This way, can use a second pair of input devices to annotate while +continuing to work normally with the first pair. -You might also need to install `automake` and `gtk3-devel`. +Alternatively, you can also use the graphical tool [gnome-device- +manager](https://github.com/bk138/gnome-device-manager) to arrange your +MPX setup. -### Configuration: +### Configuration Gromit-MPX is configurable via the file `gromit-mpx.cfg` in the directory defined by `$XDG_CONFIG_HOME` (usually `~/.config`). Here @@ -142,10 +146,8 @@ "green Marker" = RECOLOR (color = "Limegreen"); - If you define a tool with the same name as an input-device -(see the output of `xsetpointer -l`, if there is a `SWITCH`-Tool -it is uninteresting...) this input-device uses this tool. +(see the output of `xinput --list`) this input-device uses this tool. Additionally you can limit the Scope to specific combinations of Mousebuttons (1,2,3,4,5 or Button1,...,Button5) and Modifiers (`SHIFT`, `CONTROL`, `ALT`, `META`, while `ALT==META`). @@ -156,7 +158,7 @@ "Core Pointer"[2] = "green Marker"; "Core Pointer"[Button3] = "Eraser"; -The descision, which tool to use follows a simple policy: +The descision which tool to use follows a simple policy: 1. Buttons are more important than Modifiers 2. Low number Buttons are more important than higher ones @@ -166,10 +168,21 @@ and only `SHIFT` actually is pressed, Gromit-MPX will use the second definition if there is no `"Core Pointer"[SHIFT]` definition. The same logic holds for the buttons. +5. Slave device config takes precedence over master device config, which + in turn takes precedence over the fallback default config. + +## Building it +Gromit-MPX uses CMake as its build system. Thus, it's the usual: + mkdir build + cd build + cmake .. + make -### Potential Problems: +from the root of the source tree. + +## Potential Problems When there is no compositing manager such as Compiz or xcompmgr running, Gromit-MPX falls back to a legacy drawing mode. This may @@ -179,11 +192,8 @@ terminal-programs tend to scroll incredibly slow if something is painted over their window. - - Like the original Gromit, this program is distributed under the Gnu General Public License. See the file `COPYING` for details. Thanks to Simon for the groundwork done! - ---[Christian Beier](mailto:dontmind@freeshell.org) diff -Nru gromit-mpx-1.2/src/callbacks.c gromit-mpx-1.3/src/callbacks.c --- gromit-mpx-1.2/src/callbacks.c 2016-11-16 21:44:50.000000000 +0000 +++ gromit-mpx-1.3/src/callbacks.c 2018-12-28 15:39:41.000000000 +0000 @@ -23,6 +23,7 @@ #include #include +#include #include "gromit-mpx.h" #include "input.h" #include "callbacks.h" @@ -89,13 +90,13 @@ { GromitData *data = (GromitData *) user_data; - if(data->debug) - g_printerr("DEBUG: screen size changed!\n"); - // get new sizes data->width = gdk_screen_get_width (data->screen); data->height = gdk_screen_get_height (data->screen); + if(data->debug) + g_printerr("DEBUG: screen size changed to %d x %d!\n", data->width, data->height); + // change size gtk_widget_set_size_request(GTK_WIDGET(data->win), data->width, data->height); // try to set transparent for input @@ -235,45 +236,40 @@ gdouble pressure = 1; /* get the data for this device */ - GdkDevice *master = ev->device; - GromitDeviceData *masterdata = - g_hash_table_lookup(data->devdatatable, master); - GdkDevice *slave = - gdk_event_get_source_device ((GdkEvent *) ev); - GromitDeviceData *slavedata = - g_hash_table_lookup(data->devdatatable, slave); + GromitDeviceData *devdata = g_hash_table_lookup(data->devdatatable, ev->device); if(data->debug) g_printerr("DEBUG: Device '%s': Button %i Down at (x,y)=(%.2f : %.2f)\n", - gdk_device_get_name(slave), ev->button, ev->x, ev->y); + gdk_device_get_name(ev->device), ev->button, ev->x, ev->y); - if (!masterdata->is_grabbed) + if (!devdata->is_grabbed) return FALSE; + /* See GdkModifierType. Am I fixing a Gtk misbehaviour??? */ ev->state |= 1 << (ev->button + 7); - if (ev->state != masterdata->state || - ev->state != slavedata->state || - masterdata->lastslave != slave) - select_tool (data, master, slave, ev->state); - - slavedata->lastx = ev->x; - slavedata->lasty = ev->y; - slavedata->motion_time = ev->time; + + if (ev->state != devdata->state || + devdata->lastslave != gdk_event_get_source_device ((GdkEvent *) ev)) + select_tool (data, ev->device, gdk_event_get_source_device ((GdkEvent *) ev), ev->state); + + devdata->lastx = ev->x; + devdata->lasty = ev->y; + devdata->motion_time = ev->time; snap_undo_state (data); gdk_event_get_axis ((GdkEvent *) ev, GDK_AXIS_PRESSURE, &pressure); data->maxwidth = (CLAMP (pressure + line_thickener, 0, 1) * - (double) (slavedata->cur_context->width - - slavedata->cur_context->minwidth) + - slavedata->cur_context->minwidth); + (double) (devdata->cur_context->width - + devdata->cur_context->minwidth) + + devdata->cur_context->minwidth); if (ev->button <= 5) - draw_line (data, slave, ev->x, ev->y, ev->x, ev->y); + draw_line (data, ev->device, ev->x, ev->y, ev->x, ev->y); - coord_list_prepend (data, slave, ev->x, ev->y, data->maxwidth); + coord_list_prepend (data, ev->device, ev->x, ev->y, data->maxwidth); return TRUE; } @@ -288,38 +284,22 @@ gint nevents; int i; gdouble pressure = 1; - /* get the data for this device */ - GdkDevice *master = ev->device; - GromitDeviceData *masterdata = - g_hash_table_lookup(data->devdatatable, master); + GromitDeviceData *devdata = g_hash_table_lookup(data->devdatatable, ev->device); - if (!masterdata->is_grabbed) + if (!devdata->is_grabbed) return FALSE; - GdkDevice *slave = - gdk_event_get_source_device ((GdkEvent *) ev); - GromitDeviceData *slavedata = - g_hash_table_lookup(data->devdatatable, slave); - if(data->debug) - g_printerr("DEBUG: Device '%s': motion to (x,y)=(%.2f : %.2f)\n", gdk_device_get_name(slave), ev->x, ev->y); - - if (ev->state != masterdata->state || - ev->state != slavedata->state || - masterdata->lastslave != slave) - select_tool (data, master, slave, ev->state); - - if(!(ev->state & (GDK_BUTTON1_MASK| - GDK_BUTTON2_MASK| - GDK_BUTTON3_MASK| - GDK_BUTTON4_MASK| - GDK_BUTTON5_MASK))) - return TRUE; + g_printerr("DEBUG: Device '%s': motion to (x,y)=(%.2f : %.2f)\n", gdk_device_get_name(ev->device), ev->x, ev->y); - gdk_device_get_history (slave, ev->window, - slavedata->motion_time, ev->time, - &coords, &nevents); + if (ev->state != devdata->state || + devdata->lastslave != gdk_event_get_source_device ((GdkEvent *) ev)) + select_tool (data, ev->device, gdk_event_get_source_device ((GdkEvent *) ev), ev->state); + + gdk_device_get_history (ev->device, ev->window, + devdata->motion_time, ev->time, + &coords, &nevents); if(!data->xinerama && nevents > 0) { @@ -327,29 +307,29 @@ { gdouble x, y; - gdk_device_get_axis (slave, coords[i]->axes, + gdk_device_get_axis (ev->device, coords[i]->axes, GDK_AXIS_PRESSURE, &pressure); if (pressure > 0) { data->maxwidth = (CLAMP (pressure + line_thickener, 0, 1) * - (double) (slavedata->cur_context->width - - slavedata->cur_context->minwidth) + - slavedata->cur_context->minwidth); + (double) (devdata->cur_context->width - + devdata->cur_context->minwidth) + + devdata->cur_context->minwidth); - gdk_device_get_axis(slave, coords[i]->axes, + gdk_device_get_axis(ev->device, coords[i]->axes, GDK_AXIS_X, &x); - gdk_device_get_axis(slave, coords[i]->axes, + gdk_device_get_axis(ev->device, coords[i]->axes, GDK_AXIS_Y, &y); - draw_line (data, slave, slavedata->lastx, slavedata->lasty, x, y); + draw_line (data, ev->device, devdata->lastx, devdata->lasty, x, y); - coord_list_prepend (data, slave, x, y, data->maxwidth); - slavedata->lastx = x; - slavedata->lasty = y; + coord_list_prepend (data, ev->device, x, y, data->maxwidth); + devdata->lastx = x; + devdata->lasty = y; } } - slavedata->motion_time = coords[nevents-1]->time; + devdata->motion_time = coords[nevents-1]->time; g_free (coords); } @@ -359,20 +339,20 @@ if (pressure > 0) { data->maxwidth = (CLAMP (pressure + line_thickener, 0, 1) * - (double) (slavedata->cur_context->width - - slavedata->cur_context->minwidth) + - slavedata->cur_context->minwidth); + (double) (devdata->cur_context->width - + devdata->cur_context->minwidth) + + devdata->cur_context->minwidth); - if(slavedata->motion_time > 0) + if(devdata->motion_time > 0) { - draw_line (data, slave, slavedata->lastx, slavedata->lasty, ev->x, ev->y); - coord_list_prepend (data, slave, ev->x, ev->y, data->maxwidth); + draw_line (data, ev->device, devdata->lastx, devdata->lasty, ev->x, ev->y); + coord_list_prepend (data, ev->device, ev->x, ev->y, data->maxwidth); } } - slavedata->lastx = ev->x; - slavedata->lasty = ev->y; - slavedata->motion_time = ev->time; + devdata->lastx = ev->x; + devdata->lasty = ev->y; + devdata->motion_time = ev->time; return TRUE; } @@ -383,40 +363,28 @@ gpointer user_data) { GromitData *data = (GromitData *) user_data; - - /* get the data for this device */ - GdkDevice *master = ev->device; - GromitDeviceData *masterdata = - g_hash_table_lookup(data->devdatatable, master); - GdkDevice *slave = - gdk_event_get_source_device ((GdkEvent *) ev); - GromitDeviceData *slavedata = - g_hash_table_lookup(data->devdatatable, slave); - - if(data->debug) - g_printerr("DEBUG: Device '%s': Button %i Up at (x,y)=(%.2f : %.2f)\n", - gdk_device_get_name(slave), ev->button, ev->x, ev->y); + /* get the device data for this event */ + GromitDeviceData *devdata = g_hash_table_lookup(data->devdatatable, ev->device); gfloat direction = 0; gint width = 0; - if(slavedata->cur_context) - width = slavedata->cur_context->arrowsize * - slavedata->cur_context->width / 2; + if(devdata->cur_context) + width = devdata->cur_context->arrowsize * devdata->cur_context->width / 2; + - if ((ev->x != slavedata->lastx) || - (ev->y != slavedata->lasty)) + if ((ev->x != devdata->lastx) || + (ev->y != devdata->lasty)) on_motion(win, (GdkEventMotion *) ev, user_data); - - if (!masterdata->is_grabbed) + if (!devdata->is_grabbed) return FALSE; - - if (slavedata->cur_context->arrowsize != 0 && - coord_list_get_arrow_param (data, slave, width * 3, + + if (devdata->cur_context->arrowsize != 0 && + coord_list_get_arrow_param (data, ev->device, width * 3, &width, &direction)) - draw_arrow (data, slave, ev->x, ev->y, width, direction); + draw_arrow (data, ev->device, ev->x, ev->y, width, direction); - coord_list_free (data, slave); + coord_list_free (data, ev->device); return TRUE; } @@ -518,12 +486,11 @@ gpointer user_data) { GromitData *data = (GromitData *) user_data; - GdkInputSource hardware_type = gdk_device_get_source(device); - - if( hardware_type == GDK_SOURCE_KEYBOARD || - gdk_device_get_n_axes(device) < 2) + + if(!gdk_device_get_device_type(device) == GDK_DEVICE_TYPE_MASTER + || gdk_device_get_n_axes(device) < 2) return; - + if(data->debug) g_printerr("DEBUG: device '%s' removed\n", gdk_device_get_name(device)); @@ -535,10 +502,9 @@ gpointer user_data) { GromitData *data = (GromitData *) user_data; - GdkInputSource hardware_type = gdk_device_get_source(device); - if( hardware_type == GDK_SOURCE_KEYBOARD || - gdk_device_get_n_axes(device) < 2) + if(!gdk_device_get_device_type(device) == GDK_DEVICE_TYPE_MASTER + || gdk_device_get_n_axes(device) < 2) return; if(data->debug) @@ -555,14 +521,11 @@ { GromitData *data = (GromitData *) user_data; - GdkDevice *master = ev->device; - GdkDevice *slave = gdk_event_get_source_device ((GdkEvent *) ev); - if(data->debug) g_printerr("DEBUG: Device '%s': Button %i on_toggle_paint at (x,y)=(%.2f : %.2f)\n", - gdk_device_get_name(slave), ev->button, ev->x, ev->y); + gdk_device_get_name(ev->device), ev->button, ev->x, ev->y); - toggle_grab(data, master); + toggle_grab(data, ev->device); return TRUE; } @@ -634,42 +597,23 @@ } -void on_help(GtkMenuItem *menuitem, - gpointer user_data) -{ - GromitData *data = (GromitData *) user_data; - - gchar helpString[4096]; - snprintf(helpString, 4096, "The available commands are:\n\n\ - toggle painting: %s\n\ - clear screen: SHIFT-%s\n\ - toggle visibility: CTRL-%s\n\ - quit: ALT-%s\n\ - undo last stroke: %s\n\ - redo last undone stroke: SHIFT-%s", - data->hot_keyval, data->hot_keyval, data->hot_keyval, data->hot_keyval, - data->undo_keyval, data->undo_keyval); - - GtkWidget *dialog = gtk_message_dialog_new(NULL, - GTK_DIALOG_DESTROY_WITH_PARENT, - GTK_MESSAGE_INFO, - GTK_BUTTONS_CLOSE, - NULL); - gtk_message_dialog_set_markup (GTK_MESSAGE_DIALOG (dialog), helpString); - - g_signal_connect_swapped (dialog, "response", - G_CALLBACK (gtk_widget_destroy), - dialog); - - gtk_widget_show_all(dialog); -} - - - void on_about(GtkMenuItem *menuitem, gpointer user_data) { - const gchar *authors [] = { "Christian Beier ", "Simon Budig ", NULL }; + const gchar *authors [] = { "Christian Beier ", + "Simon Budig ", + "Barak A. Pearlmutter ", + "Nathan Whitehead ", + "Lukáš Hermann ", + "Katie Holly ", + "Monty Montgomery ", + "AlisterH ", + "Mehmet Atif Ergun ", + "Russel Winder ", + "Tao Klerks ", + "Tobias Schönberg ", + "Yuri D'Elia ", + NULL }; gtk_show_about_dialog (NULL, "program-name", "Gromit-MPX", "logo-icon-name", "gromit-mpx", @@ -678,9 +622,82 @@ "version", VERSION, "website", "https://github.com/bk138/gromit-mpx", "authors", authors, - "copyright", "Copyright 2000 Simon Budig, 2009-2016 Christian Beier", + "copyright", "Copyright 2000 Simon Budig, 2009-2018 Christian Beier", "license-type", GTK_LICENSE_GPL_2_0, NULL); } +static void on_intro_show_again_button_toggled(GtkCheckButton *toggle, GromitData *data) +{ + data->show_intro_on_startup = gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (toggle)); +} + +void on_intro(GtkMenuItem *menuitem, + gpointer user_data) +{ + GromitData *data = (GromitData *) user_data; + + // Create a new assistant widget with no pages. + GtkWidget *assistant = gtk_assistant_new (); + gtk_window_set_position (GTK_WINDOW(assistant), GTK_WIN_POS_CENTER); + + // set page one + GtkWidget *widgetOne = gtk_label_new ("Gromit-MPX (GRaphics Over MIscellaneous Things) is a small tool to make\n" + "annotations on the screen.\n\n" + "Its main use is for making presentations of some application. Normally,\n" + "you would have to move the mouse pointer around the point of interest\n" + "until hopefully everybody noticed it. With Gromit-MPX, you can draw\n" + "everywhere onto the screen, highlighting some button or area."); + gtk_assistant_append_page (GTK_ASSISTANT (assistant), widgetOne); + gtk_assistant_set_page_title (GTK_ASSISTANT (assistant), widgetOne, "Gromit-MPX - What is it?"); + gtk_assistant_set_page_type (GTK_ASSISTANT (assistant), widgetOne, GTK_ASSISTANT_PAGE_INTRO); + gtk_assistant_set_page_complete (GTK_ASSISTANT (assistant), widgetOne, TRUE); + + // set page two + GtkWidget *widgetTwo = gtk_label_new (NULL); + char widgetTwoBuf[4096]; + snprintf(widgetTwoBuf, sizeof(widgetTwoBuf), + "You can operate Gromit-MPX using its tray icon (if your desktop environment\n" + "provides a sys tray), but since you typically want to use the program you are\n" + "demonstrating and highlighting something is a short interruption of your\n" + "workflow, Gromit-MPX can be toggled on and off on the fly via a hotkey:\n\n" + "It grabs the `%s` and `%s` keys, so that no other application can use them\n" + "and they are available to Gromit-MPX only. The available commands are:\n\n" + " toggle painting: %s\n" + " clear screen: SHIFT-%s\n" + " toggle visibility: CTRL-%s\n" + " quit: ALT-%s\n" + " undo last stroke: %s\n" + " redo last undone stroke: SHIFT-%s", + data->hot_keyval, data->undo_keyval, + data->hot_keyval, data->hot_keyval, data->hot_keyval, data->hot_keyval, data->undo_keyval, data->undo_keyval); + gtk_label_set_markup (GTK_LABEL (widgetTwo), widgetTwoBuf); + gtk_assistant_append_page (GTK_ASSISTANT (assistant), widgetTwo); + gtk_assistant_set_page_title (GTK_ASSISTANT (assistant), widgetTwo, "Gromit-MPX - How to use it"); + gtk_assistant_set_page_type (GTK_ASSISTANT (assistant), widgetTwo, GTK_ASSISTANT_PAGE_CONTENT); + gtk_assistant_set_page_complete (GTK_ASSISTANT (assistant), widgetTwo, TRUE); + + // set page three + GtkWidget *widgetThree = gtk_grid_new (); + GtkWidget *widgetThreeText = gtk_label_new ("Do you want to show this introduction again on the next start of Gromit-MPX?\n" + "You can always access it again via the sys tray menu.\n"); + GtkWidget *widgetThreeButton = gtk_check_button_new_with_label ("Show again on startup"); + gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(widgetThreeButton), data->show_intro_on_startup); + gtk_grid_attach (GTK_GRID (widgetThree), widgetThreeText, 0, 0, 1, 1); + gtk_grid_attach_next_to (GTK_GRID (widgetThree), widgetThreeButton, widgetThreeText, GTK_POS_BOTTOM, 1, 1); + g_signal_connect (G_OBJECT (widgetThreeButton), "toggled", + G_CALLBACK (on_intro_show_again_button_toggled), data); + gtk_assistant_append_page (GTK_ASSISTANT (assistant), widgetThree); + gtk_assistant_set_page_type (GTK_ASSISTANT (assistant), widgetThree, GTK_ASSISTANT_PAGE_CONFIRM); + gtk_assistant_set_page_complete (GTK_ASSISTANT (assistant), widgetThree, TRUE); + + // connect the close buttons + g_signal_connect (G_OBJECT (assistant), "cancel", + G_CALLBACK (gtk_widget_destroy), NULL); + g_signal_connect (G_OBJECT (assistant), "close", + G_CALLBACK (gtk_widget_destroy), NULL); + + // show + gtk_widget_show_all (assistant); +} diff -Nru gromit-mpx-1.2/src/callbacks.h gromit-mpx-1.3/src/callbacks.h --- gromit-mpx-1.2/src/callbacks.h 2016-11-16 21:44:50.000000000 +0000 +++ gromit-mpx-1.3/src/callbacks.h 2018-12-28 15:39:41.000000000 +0000 @@ -65,11 +65,6 @@ gboolean on_buttonrelease (GtkWidget *win, GdkEventButton *ev, gpointer user_data); -gboolean on_proximity_in (GtkWidget *win, GdkEventProximity *ev, gpointer user_data); - -gboolean on_proximity_out (GtkWidget *win, GdkEventProximity *ev, gpointer user_data); - - void on_mainapp_selection_get (GtkWidget *widget, GtkSelectionData *selection_data, guint info, @@ -122,13 +117,10 @@ void on_redo(GtkMenuItem *menuitem, gpointer user_data); - -void on_help(GtkMenuItem *menuitem, - gpointer user_data); - void on_about(GtkMenuItem *menuitem, gpointer user_data); - +void on_intro(GtkMenuItem *menuitem, + gpointer user_data); #endif diff -Nru gromit-mpx-1.2/src/config.c gromit-mpx-1.3/src/config.c --- gromit-mpx-1.2/src/config.c 2016-11-16 21:44:50.000000000 +0000 +++ gromit-mpx-1.3/src/config.c 2018-12-28 15:39:41.000000000 +0000 @@ -22,6 +22,7 @@ */ #include +#include #include #include #include @@ -29,6 +30,9 @@ #include "gromit-mpx.h" +#define KEY_DFLT_SHOW_INTRO_ON_STARTUP TRUE + +#define KEYFILE_FLAGS G_KEY_FILE_KEEP_COMMENTS|G_KEY_FILE_KEEP_TRANSLATIONS /* * Functions for parsing the Configuration-file @@ -362,3 +366,57 @@ g_free (filename); } + +void read_keyfile(GromitData *data) +{ + gchar *filename = g_strjoin (G_DIR_SEPARATOR_S, + g_get_user_config_dir(), "gromit-mpx.ini", NULL); + + /* + set defaults + */ + data->show_intro_on_startup = KEY_DFLT_SHOW_INTRO_ON_STARTUP; + + /* + read actual settings + */ + GError *error = NULL; + GKeyFile *key_file = g_key_file_new (); + + if (!g_key_file_load_from_file (key_file, filename, KEYFILE_FLAGS, &error)) { + // treat file-not-found not as an error + if (!g_error_matches (error, G_FILE_ERROR, G_FILE_ERROR_NOENT)) + g_warning ("Error loading key file: %s", error->message); + g_error_free(error); + goto cleanup; + } + + data->show_intro_on_startup = g_key_file_get_boolean (key_file, "General", "ShowIntroOnStartup", &error); + + cleanup: + g_free(filename); + g_key_file_free(key_file); +} + + +void write_keyfile(GromitData *data) +{ + gchar *filename = g_strjoin (G_DIR_SEPARATOR_S, + g_get_user_config_dir(), "gromit-mpx.ini", NULL); + + GError *error = NULL; + GKeyFile *key_file = g_key_file_new (); + + g_key_file_set_boolean (key_file, "General", "ShowIntroOnStartup", data->show_intro_on_startup); + + // Save as a file. + if (!g_key_file_save_to_file (key_file, filename, &error)) { + g_warning ("Error saving key file: %s", error->message); + g_error_free(error); + goto cleanup; + } + + cleanup: + g_free(filename); + g_key_file_free(key_file); +} diff -Nru gromit-mpx-1.2/src/config.h gromit-mpx-1.3/src/config.h --- gromit-mpx-1.2/src/config.h 2016-11-16 21:44:50.000000000 +0000 +++ gromit-mpx-1.3/src/config.h 2018-12-28 15:39:41.000000000 +0000 @@ -42,4 +42,8 @@ #define DEFAULT_OPACITY 0.75 #endif +void read_keyfile(GromitData *data); + +void write_keyfile(GromitData *data); + #endif diff -Nru gromit-mpx-1.2/src/gromit-mpx.c gromit-mpx-1.3/src/gromit-mpx.c --- gromit-mpx-1.2/src/gromit-mpx.c 2016-11-16 21:44:50.000000000 +0000 +++ gromit-mpx-1.3/src/gromit-mpx.c 2018-12-28 15:39:41.000000000 +0000 @@ -316,27 +316,27 @@ void select_tool (GromitData *data, - GdkDevice *master, - GdkDevice *slave, + GdkDevice *device, + GdkDevice *slave_device, guint state) { - guint buttons = 0, modifier = 0, len = 0, default_len = 0; + guint buttons = 0, modifier = 0, slave_len = 0, len = 0, default_len = 0; guint req_buttons = 0, req_modifier = 0; guint i, j, success = 0; GromitPaintContext *context = NULL; + guchar *slave_name; guchar *name; guchar *default_name; /* get the data for this device */ - GromitDeviceData *masterdata = - g_hash_table_lookup(data->devdatatable, master); - GromitDeviceData *slavedata = - g_hash_table_lookup(data->devdatatable, slave); + GromitDeviceData *devdata = g_hash_table_lookup(data->devdatatable, device); - if (slave) + if (device) { - len = strlen (gdk_device_get_name(slave)); - name = (guchar*) g_strndup (gdk_device_get_name(slave), len + 3); + slave_len = strlen (gdk_device_get_name(slave_device)); + slave_name = (guchar*) g_strndup (gdk_device_get_name(slave_device), slave_len + 3); + len = strlen (gdk_device_get_name(device)); + name = (guchar*) g_strndup (gdk_device_get_name(device), len + 3); default_len = strlen(DEFAULT_DEVICE_NAME); default_name = (guchar*) g_strndup (DEFAULT_DEVICE_NAME, default_len + 3); @@ -347,6 +347,8 @@ req_modifier = (state >> 1) & 7; if (state & GDK_SHIFT_MASK) req_modifier |= 1; + slave_name [slave_len] = 124; + slave_name [slave_len+3] = 0; name [len] = 124; name [len+3] = 0; default_name [default_len] = 124; @@ -364,28 +366,37 @@ { j++; modifier = req_modifier & ((1 << j)-1); + slave_name [slave_len+1] = buttons + 64; + slave_name [slave_len+2] = modifier + 48; name [len+1] = buttons + 64; name [len+2] = modifier + 48; default_name [default_len+1] = buttons + 64; default_name [default_len+2] = modifier + 48; - if(data->debug) - g_printerr("DEBUG: Looking up context %s\n", name); + if(data->debug) + g_printerr("DEBUG: select_tool looking up context for '%s' attached to '%s'\n", slave_name, name); - context = g_hash_table_lookup (data->tool_config, name); - if(context) + context = g_hash_table_lookup (data->tool_config, slave_name); + if(context) { + if(data->debug) + g_printerr("DEBUG: select_tool set context for '%s'\n", slave_name); + devdata->cur_context = context; + success = 1; + } + else /* try master name */ + if ((context = g_hash_table_lookup (data->tool_config, name))) { if(data->debug) - g_printerr("DEBUG: Context %s set\n", name); - slavedata->cur_context = context; + g_printerr("DEBUG: select_tool set context for '%s'\n", name); + devdata->cur_context = context; success = 1; } else /* try default_name */ if((context = g_hash_table_lookup (data->tool_config, default_name))) { if(data->debug) - g_printerr("DEBUG: Default context %s set\n", default_name); - slavedata->cur_context = context; + g_printerr("DEBUG: select_tool set default context '%s' for '%s'\n", default_name, name); + devdata->cur_context = context; success = 1; } @@ -399,30 +410,30 @@ if (!success) { - if (gdk_device_get_source(slave) == GDK_SOURCE_ERASER) - slavedata->cur_context = data->default_eraser; + if (gdk_device_get_source(device) == GDK_SOURCE_ERASER) + devdata->cur_context = data->default_eraser; else - slavedata->cur_context = data->default_pen; + devdata->cur_context = data->default_pen; } } else - g_printerr ("ERROR: Attempt to select nonexistent device!\n"); + g_printerr ("ERROR: select_tool attempted to select nonexistent device!\n"); GdkCursor *cursor; - if(slavedata->cur_context && slavedata->cur_context->type == GROMIT_ERASER) - cursor = data->erase_cursor; + if(devdata->cur_context && devdata->cur_context->type == GROMIT_ERASER) + cursor = data->erase_cursor; else cursor = data->paint_cursor; if(data->debug) - g_printerr("DEBUG: Setting cursor %p\n",cursor); + g_printerr("DEBUG: select_tool setting cursor %p\n",cursor); //FIXME! Should be: //gdk_window_set_cursor(gtk_widget_get_window(data->win), cursor); // doesn't work during a grab? - gdk_device_grab(master, + gdk_device_grab(device, gtk_widget_get_window(data->win), GDK_OWNERSHIP_NONE, FALSE, @@ -430,9 +441,8 @@ cursor, GDK_CURRENT_TIME); - masterdata->lastslave = slave; - masterdata->state = state; - slavedata->state = state; + devdata->state = state; + devdata->lastslave = slave_device; } @@ -784,7 +794,11 @@ parse_config (data); if (data->debug) g_hash_table_foreach (data->tool_config, parse_print_help, NULL); - + + /* + parse key file + */ + read_keyfile(data); /* FIND HOTKEY KEYCODE @@ -887,21 +901,28 @@ /* create the menu */ GtkWidget *menu = gtk_menu_new (); + char labelBuf[128]; /* Create the menu items */ - GtkWidget* toggle_paint_item = gtk_menu_item_new_with_label ("Toggle Painting"); - GtkWidget* clear_item = gtk_menu_item_new_with_label ("Clear Screen"); - GtkWidget* toggle_vis_item = gtk_menu_item_new_with_label ("Toggle Visibility"); + snprintf(labelBuf, sizeof(labelBuf), "Toggle Painting (%s)", data->hot_keyval); + GtkWidget* toggle_paint_item = gtk_menu_item_new_with_label (labelBuf); + snprintf(labelBuf, sizeof(labelBuf), "Clear Screen (SHIFT-%s)", data->hot_keyval); + GtkWidget* clear_item = gtk_menu_item_new_with_label (labelBuf); + snprintf(labelBuf, sizeof(labelBuf), "Toggle Visibility (CTRL-%s)", data->hot_keyval); + GtkWidget* toggle_vis_item = gtk_menu_item_new_with_label (labelBuf); GtkWidget* thicker_lines_item = gtk_menu_item_new_with_label ("Thicker Lines"); GtkWidget* thinner_lines_item = gtk_menu_item_new_with_label ("Thinner Lines"); GtkWidget* opacity_bigger_item = gtk_menu_item_new_with_label ("Bigger Opacity"); GtkWidget* opacity_lesser_item = gtk_menu_item_new_with_label ("Lesser Opacity"); - GtkWidget* undo_item = gtk_menu_item_new_with_label ("Undo"); - GtkWidget* redo_item = gtk_menu_item_new_with_label ("Redo"); + snprintf(labelBuf, sizeof(labelBuf), "Undo (%s)", data->undo_keyval); + GtkWidget* undo_item = gtk_menu_item_new_with_label (labelBuf); + snprintf(labelBuf, sizeof(labelBuf), "Redo (SHIFT-%s)", data->undo_keyval); + GtkWidget* redo_item = gtk_menu_item_new_with_label (labelBuf); GtkWidget* sep_item = gtk_separator_menu_item_new(); - GtkWidget* help_item = gtk_menu_item_new_with_mnemonic("_Help"); + GtkWidget* intro_item = gtk_menu_item_new_with_mnemonic("_Introduction"); GtkWidget* about_item = gtk_menu_item_new_with_mnemonic("_About"); - GtkWidget* quit_item = gtk_menu_item_new_with_mnemonic("_Quit"); + snprintf(labelBuf, sizeof(labelBuf), "_Quit (ALT-%s)", data->hot_keyval); + GtkWidget* quit_item = gtk_menu_item_new_with_mnemonic(labelBuf); /* Add them to the menu */ @@ -916,7 +937,7 @@ gtk_menu_shell_append (GTK_MENU_SHELL (menu), redo_item); gtk_menu_shell_append (GTK_MENU_SHELL (menu), sep_item); - gtk_menu_shell_append (GTK_MENU_SHELL (menu), help_item); + gtk_menu_shell_append (GTK_MENU_SHELL (menu), intro_item); gtk_menu_shell_append (GTK_MENU_SHELL (menu), about_item); gtk_menu_shell_append (GTK_MENU_SHELL (menu), quit_item); @@ -950,8 +971,8 @@ G_CALLBACK (on_redo), data); - g_signal_connect(G_OBJECT (help_item), "activate", - G_CALLBACK (on_help), + g_signal_connect(G_OBJECT (intro_item), "activate", + G_CALLBACK (on_intro), data); g_signal_connect(G_OBJECT (about_item), "activate", G_CALLBACK (on_about), @@ -973,13 +994,15 @@ gtk_widget_show (redo_item); gtk_widget_show (sep_item); - gtk_widget_show (help_item); + gtk_widget_show (intro_item); gtk_widget_show (about_item); gtk_widget_show (quit_item); app_indicator_set_menu (data->trayicon, GTK_MENU(menu)); + if(data->show_intro_on_startup) + on_intro(NULL, data); } @@ -1057,7 +1080,7 @@ } else { - g_printerr ("-o requires an opacity >= 0,0 && <=1,0 as argument\n"); + g_printerr ("-o requires an opacity >=0 and <=1 as argument\n"); wrong_arg = TRUE; } } @@ -1264,6 +1287,7 @@ setup_main_app (data, app_parse_args (argc, argv, data)); gtk_main (); release_grab(data, NULL); /* ungrab all */ + write_keyfile(data); // save keyfile config g_free (data); return 0; } diff -Nru gromit-mpx-1.2/src/gromit-mpx.h gromit-mpx-1.3/src/gromit-mpx.h --- gromit-mpx-1.2/src/gromit-mpx.h 2016-11-16 21:44:50.000000000 +0000 +++ gromit-mpx-1.3/src/gromit-mpx.h 2018-12-28 15:39:41.000000000 +0000 @@ -30,12 +30,11 @@ #include -#define GROMIT_MOUSE_EVENTS ( GDK_POINTER_MOTION_MASK | \ - GDK_BUTTON_MOTION_MASK | \ +#define GROMIT_MOUSE_EVENTS ( GDK_BUTTON_MOTION_MASK | \ GDK_BUTTON_PRESS_MASK | \ GDK_BUTTON_RELEASE_MASK ) -#define GROMIT_WINDOW_EVENTS ( GROMIT_MOUSE_EVENTS | GDK_EXPOSURE_MASK ) +#define GROMIT_WINDOW_EVENTS ( GROMIT_MOUSE_EVENTS | GDK_EXPOSURE_MASK) /* Atoms used to control Gromit */ #define GA_CONTROL gdk_atom_intern ("Gromit/control", FALSE) @@ -145,6 +144,8 @@ cairo_surface_t *undobuffer[GROMIT_MAX_UNDO]; gint undo_head, undo_depth, redo_depth; + gboolean show_intro_on_startup; + } GromitData; @@ -154,7 +155,7 @@ void parse_print_help (gpointer key, gpointer value, gpointer user_data); -void select_tool (GromitData *data, GdkDevice *master, GdkDevice *slave, guint state); +void select_tool (GromitData *data, GdkDevice *device, GdkDevice *slave_device, guint state); void copy_surface (cairo_surface_t *dst, cairo_surface_t *src); void swap_surfaces (cairo_surface_t *a, cairo_surface_t *b); diff -Nru gromit-mpx-1.2/src/input.c gromit-mpx-1.3/src/input.c --- gromit-mpx-1.2/src/input.c 2016-11-16 21:44:50.000000000 +0000 +++ gromit-mpx-1.3/src/input.c 2018-12-28 15:39:41.000000000 +0000 @@ -53,10 +53,7 @@ GList *devices, *d; int i = 0; - devices = g_list_concat(gdk_device_manager_list_devices - (device_manager, GDK_DEVICE_TYPE_MASTER), - gdk_device_manager_list_devices - (device_manager, GDK_DEVICE_TYPE_SLAVE)); + devices = gdk_device_manager_list_devices(device_manager, GDK_DEVICE_TYPE_MASTER); for(d = devices; d; d = d->next) { GdkDevice *device = (GdkDevice *) d->data; @@ -73,23 +70,18 @@ devdata->index = i; /* get attached keyboard and grab the hotkey */ - if (!data->hot_keycode || !data->undo_keycode) + if (!data->hot_keycode && !data->undo_keycode) { - g_printerr("ERROR: Grabbing hotkey from attached keyboard " - "of '%s' failed, no hotkeys defined.\n", + g_printerr("ERROR: Grabbing hotkey from attached keyboard of '%s' failed, no hotkey defined.\n", gdk_device_get_name(device)); g_free(devdata); continue; } - /* if this is a slave device, we need the master */ - GdkDevice *kdevice=device; - if(gdk_device_get_device_type (device) == GDK_DEVICE_TYPE_SLAVE) - kdevice=gdk_device_get_associated_device (device); if (GDK_IS_X11_DISPLAY(data->display)) { gint dev_id = -1; - g_object_get(kdevice, "device-id", &dev_id, NULL); + g_object_get(device, "device-id", &dev_id, NULL); gint kbd_dev_id = -1; XIDeviceInfo* devinfo; @@ -120,27 +112,31 @@ gdk_error_trap_push (); - XIGrabKeycode( GDK_DISPLAY_XDISPLAY(data->display), - kbd_dev_id, - data->hot_keycode, - GDK_WINDOW_XID(data->root), - GrabModeAsync, - GrabModeAsync, - True, - &mask, - nmods, - modifiers); - - XIGrabKeycode( GDK_DISPLAY_XDISPLAY(data->display), - kbd_dev_id, - data->undo_keycode, - GDK_WINDOW_XID(data->root), - GrabModeAsync, - GrabModeAsync, - True, - &mask, - nmods, - modifiers); + if (data->hot_keycode) { + XIGrabKeycode( GDK_DISPLAY_XDISPLAY(data->display), + kbd_dev_id, + data->hot_keycode, + GDK_WINDOW_XID(data->root), + GrabModeAsync, + GrabModeAsync, + True, + &mask, + nmods, + modifiers); + } + + if (data->undo_keycode) { + XIGrabKeycode( GDK_DISPLAY_XDISPLAY(data->display), + kbd_dev_id, + data->undo_keycode, + GDK_WINDOW_XID(data->root), + GrabModeAsync, + GrabModeAsync, + True, + &mask, + nmods, + modifiers); + } XSync(GDK_DISPLAY_XDISPLAY(data->display), False); if(gdk_error_trap_pop()) @@ -235,7 +231,7 @@ GdkCursor *cursor; devdata = value; - if(devdata->is_grabbed || gdk_device_get_device_type(devdata->device) == GDK_DEVICE_TYPE_SLAVE) + if(devdata->is_grabbed) continue; if(devdata->cur_context && devdata->cur_context->type == GROMIT_ERASER) @@ -271,31 +267,33 @@ return; } - GromitDeviceData *devdata = - g_hash_table_lookup(data->devdatatable, dev); + + /* get the data for this device */ + GromitDeviceData *devdata = g_hash_table_lookup(data->devdatatable, dev); + if (!devdata->is_grabbed) { GdkCursor *cursor; if(devdata->cur_context && devdata->cur_context->type == GROMIT_ERASER) - cursor = data->erase_cursor; + cursor = data->erase_cursor; else - cursor = data->paint_cursor; + cursor = data->paint_cursor; if(gdk_device_grab(devdata->device, - gtk_widget_get_window(data->win), - GDK_OWNERSHIP_NONE, - FALSE, - GROMIT_MOUSE_EVENTS, - cursor, - GDK_CURRENT_TIME) != GDK_GRAB_SUCCESS) - { - /* this probably means the device table is outdated, - e.g. this device doesn't exist anymore */ - g_printerr("Error grabbing device '%s', rescanning device list.\n", - gdk_device_get_name(devdata->device)); - setup_input_devices(data); - return; - } + gtk_widget_get_window(data->win), + GDK_OWNERSHIP_NONE, + FALSE, + GROMIT_MOUSE_EVENTS, + cursor, + GDK_CURRENT_TIME) != GDK_GRAB_SUCCESS) + { + /* this probably means the device table is outdated, + e.g. this device doesn't exist anymore */ + g_printerr("Error grabbing device '%s', rescanning device list.\n", + gdk_device_get_name(devdata->device)); + setup_input_devices(data); + return; + } devdata->is_grabbed = 1; @@ -315,11 +313,12 @@ release_grab (data, NULL); else acquire_grab (data, NULL); - return; + return; } - GromitDeviceData *devdata = - g_hash_table_lookup(data->devdatatable, dev); + /* get the data for this device */ + GromitDeviceData *devdata = g_hash_table_lookup(data->devdatatable, dev); + if(devdata) { if(devdata->is_grabbed) diff -Nru gromit-mpx-1.2/src/Makefile.am gromit-mpx-1.3/src/Makefile.am --- gromit-mpx-1.2/src/Makefile.am 2016-11-16 21:44:50.000000000 +0000 +++ gromit-mpx-1.3/src/Makefile.am 1970-01-01 00:00:00.000000000 +0000 @@ -1,23 +0,0 @@ -## Process this file with automake to produce Makefile.in - -AM_CFLAGS = -Wall -Wextra -Wno-unused-parameter - -AM_CPPFLAGS = \ - $(GTK3_CFLAGS) \ - $(APPINDICATOR_CFLAGS) \ - $(XINPUT2_CFLAGS) \ - $(X11_CFLAGS) - -bin_PROGRAMS = gromit-mpx - -gromit_mpx_SOURCES = \ - gromit-mpx.c \ - gromit-mpx.h \ - callbacks.c \ - callbacks.h \ - config.c \ - config.h \ - input.c \ - input.h \ - erase_cursor.xpm \ - paint_cursor.xpm diff -Nru gromit-mpx-1.2/TODO gromit-mpx-1.3/TODO --- gromit-mpx-1.2/TODO 2016-11-16 21:44:50.000000000 +0000 +++ gromit-mpx-1.3/TODO 2018-12-28 15:39:41.000000000 +0000 @@ -1,5 +1,4 @@ - -* intro screen +* Wacom stylus support * runtime option to not show annotation on every virtual desktop * spot memleaks * code cleanup \ No newline at end of file diff -Nru gromit-mpx-1.2/.travis.yml gromit-mpx-1.3/.travis.yml --- gromit-mpx-1.2/.travis.yml 2016-11-16 21:44:50.000000000 +0000 +++ gromit-mpx-1.3/.travis.yml 2018-12-28 15:39:41.000000000 +0000 @@ -4,10 +4,10 @@ # install build dependencies before_install: - - sudo apt-get install automake libgtk-3-dev libappindicator3-dev libxi-dev + - sudo apt-get install cmake libgtk-3-dev libappindicator3-dev libxi-dev -# before build script, run autoreconf -before_script: autoreconf -fiv - -# Default is "./configure && make && make test", but no tests yet -script: "./configure && make" \ No newline at end of file +# Build steps +script: + - mkdir build + - cd build + - cmake .. && make