Hi Marcel,

Thanks very much! I was aware of the issue, and wanted to do something 
slightly more subtle, where if the given string exists as an exact 
device name then we require an exact match and otherwise a substring 
match is enough. (This way, things work out of the box for slightly more 
users). But perhaps that is not really worth the trouble. So I'll do the 
"easy" change as you suggest.

Denis

On 09/01/2014 08:44 PM, Marcel Schneider wrote:
> Hello,
>
> I am kind of new to Xournal and OS-contribution in general,  but today
> I feel the urge to share a trivial patch that makes "Use Touch Screen
> as Hand Tool" usable for my machine.
>
> On my Sony Vaio Duo, the touchscreen is named "N-trig DuoSense" and
> the pen "N-trig DuoSense Pen", which confuses the current check. I
> guess this should have used a string comparison since there is now an
> UI to pick the exact device. So here we go:
>
> ---
>   src/xo-callbacks.c | 2 +-
>   1 file changed, 1 insertion(+), 1 deletion(-)
> diff --git a/src/xo-callbacks.c b/src/xo-callbacks.c
> index cb1349d..23f48e1 100755
> --- a/src/xo-callbacks.c
> +++ b/src/xo-callbacks.c
> @@ -2439,7 +2439,7 @@ on_canvas_button_press_event
> (GtkWidget       *widget,
>
>     if (!finite_sized(event->x) || !finite_sized(event->y)) return
> FALSE; // Xorg 7.3 bug
>
> -  is_touch = (strstr(event->device->name, ui.device_for_touch) !=
> NULL) && ui.use_xinput;
> +  is_touch = (strcmp(event->device->name, ui.device_for_touch) == 0)
> && ui.use_xinput;
>     if (is_touch && ui.pen_disables_touch && ui.in_proximity) return FALSE;
>
>     if (is_touch && is_core && ui.cur_item_type == ITEM_TEXT &&
> ui.touch_as_handtool && ui.in_proximity) return FALSE; // workaround
> for touch = core as handtool
>

-- 
Denis Auroux                             aur...@math.berkeley.edu
University of California, Berkeley       Tel: 510-642-4367
Department of Mathematics                Fax: 510-642-8204
817 Evans Hall # 3840
Berkeley, CA 94720-3840

------------------------------------------------------------------------------
Slashdot TV.  
Video for Nerds.  Stuff that matters.
http://tv.slashdot.org/
_______________________________________________
Xournal-devel mailing list
Xournal-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/xournal-devel

Reply via email to