NetBSD Problem Report #51348

From rhialto@falu.nl  Tue Jul 19 23:48:12 2016
Return-Path: <rhialto@falu.nl>
Received: from mail.netbsd.org (mail.netbsd.org [199.233.217.200])
	(using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
	(Client CN "mail.netbsd.org", Issuer "Postmaster NetBSD.org" (verified OK))
	by mollari.NetBSD.org (Postfix) with ESMTPS id D749B7A20F
	for <gnats-bugs@gnats.NetBSD.org>; Tue, 19 Jul 2016 23:48:12 +0000 (UTC)
Message-Id: <201607192348.u6JNm8Y3002999@murthe.falu.nl>
Date: Wed, 20 Jul 2016 01:48:08 +0200 (CEST)
From: rhialto@falu.nl
Reply-To: rhialto@falu.nl
To: gnats-bugs@NetBSD.org
Cc: rhialto@falu.nl
Subject: Left-handed Mouse doesn't (always) work [incl. likely fix]
X-Send-Pr-Version: 3.95

>Number:         51348
>Category:       xsrc
>Synopsis:       Left-handed Mouse doesn't (always) work [incl. likely fix]
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    xsrc-manager
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Tue Jul 19 23:50:00 +0000 2016
>Originator:     Rhialto
>Release:        NetBSD 7.0.1
>Organization:

>Environment:


System: NetBSD murthe.falu.nl 7.0.1 NetBSD 7.0.1 (GENERIC.201605221355Z) amd64
Architecture: x86_64
Machine: amd64
>Description:
	Left-handed Mouse doesn't (always) work [incl. likely fix]
>How-To-Repeat:


In fact it only starts failing when I use gtk3+ programs (Abiword,
wireshark-gtk, transmission-gtk), but according to the gnome bug tracker
it is really an X server issue, and supposed to be fixed in some
x-server 1.11.x version. Howevever, X in base is only "X.Org X Server
1.10.6"

In references, see 

bug reported to AbiWord:
http://bugzilla.abisource.com/show_bug.cgi?id=13775
    =>
https://bugzilla.gnome.org/show_bug.cgi?id=655928
    workaround: GDK_CORE_DEVICE_EVENTS=1
    =>
https://bugs.freedesktop.org/show_bug.cgi?id=43942

Inline from the bug reported to AbiWord:

I use Abiword 3.0.1 on NetBSD 7.0 as packaged by pkgsrc, with NetBSD's X
(not pkgsrc X).

The problems I see is that mouse clicking and dragging does not work. I
can just about click into the text of a document, but if I drag, no
selection is made. If I then try to click on any GUI element, it doesn't
register that I clicked. Instead it seems to think I tried to click into
the text, and it sometimes scrolls some text into view.

This true for all tools in the toolbar, the scrollbar for the document,
even the menus and the layout ruler at the top of the text.

Sometimes if I switch to a different workspace and back, then the GUI
elements work for a short time.

This problem did not exist before version 3.0 (probably related to the
use of the new look of gtk3).
...
I have considered that it may be a gtk3 bug in general, but given my
results on my laptop it gets even weirder: With Calibre (the ebook
viewer/manager), which is a Qt program, there is also a difference
between the two computers. On the laptop again it's fine, on the desktop
it always selects whole paragraphs of text even when single clicking.

...

I had the inspiration to try to undo my left-handed mouse, and then the
problem went away. I set it up with

    xmodmap -e "pointer = 3 2 1 4 5 6 7 8 9 10 11"

When I went to report a gtk3+ bug, I found existing reports, which point
to "XI2" and/or the X server. According to the 3rd link above, it is
supposed to be fixed in some X server version 1.11.x.

>Fix:

Since the X server in base is 1.10.6, an update to 1.11.x after december
2011 would be good (or at least a pull-up of the equivalent of
https://patchwork.freedesktop.org/patch/8367/ ) I didn't check this
myself but apparently it fixes the problem.

Looking at that patch, the file
xsrc/external/mit/xorg-server/dist/dix/inpututils.c doesn't seem to
match the patch: it does not even contain the string
"mouse->button->down". That fragment does however occur in 3 other
locations:

:.../mit/xorg-server/dist$ grep -r "mouse->button->down" .
./Xi/exevents.c:        if (BitIsOn(mouse->button->down, i))
./Xi/exevents.c:        if (BitIsOn(mouse->button->down, i))
./dix/events.c:        if (BitIsOn(mouse->button->down, i))

I am not sure if the change needs to be applied to all 3 locations or
just the file in ./dix. I suspect the former.

In the mean time there is a workaround to set the environment variable
GDK_CORE_DEVICE_EVENTS=1 which is documented as "If set, GDK makes does
not use the XInput extension, and only reacts to core X input events. ".

-Olaf.
-- 
___ Olaf 'Rhialto' Seibert  -- Wayland: Those who don't understand X
\X/ rhialto/at/xs4all.nl    -- are condemned to reinvent it. Poorly.

>Unformatted:

NetBSD Home
NetBSD PR Database Search

(Contact us) $NetBSD: query-full-pr,v 1.39 2013/11/01 18:47:49 spz Exp $
$NetBSD: gnats_config.sh,v 1.8 2006/05/07 09:23:38 tsutsui Exp $
Copyright © 1994-2014 The NetBSD Foundation, Inc. ALL RIGHTS RESERVED.