From owner-freebsd-questions@FreeBSD.ORG Thu Sep 2 15:35:51 2010 Return-Path: Delivered-To: freebsd-questions@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 962BE10656E8; Thu, 2 Sep 2010 15:35:51 +0000 (UTC) (envelope-from web@umich.edu) Received: from hackers.mr.itd.umich.edu (smtp.mail.umich.edu [141.211.14.81]) by mx1.freebsd.org (Postfix) with ESMTP id 0339F8FC1A; Thu, 2 Sep 2010 15:35:50 +0000 (UTC) Received: FROM itcom245.staff.itd.umich.edu (itcom245.staff.itd.umich.edu [141.213.135.249]) By hackers.mr.itd.umich.edu ID 4C7FC455.63230.13908 ; Authuser web; 2 Sep 2010 11:35:49 EDT Date: Thu, 2 Sep 2010 11:31:15 -0400 From: William Bulley To: FreeBSD Questions Message-ID: <20100902153115.GA85154@itcom245.staff.itd.umich.edu> Mail-Followup-To: FreeBSD Questions , x11@FreeBSD.org, steve@FreeBSD.org Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="NzB8fVQJ5HfG6fxh" Content-Disposition: inline User-Agent: Mutt/1.4.2.3i Cc: x11@FreeBSD.org, steve@FreeBSD.org Subject: SOLVED: serious (for me) Xorg 7.5 mouse/kbd problem in 8.1-STABLE X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 02 Sep 2010 15:35:51 -0000 --NzB8fVQJ5HfG6fxh Content-Type: text/plain; charset=us-ascii Content-Disposition: inline See below for details of solution. ----- Forwarded message from William Bulley ----- To: FreeBSD Questions From: William Bulley Date: Wed, 25 Aug 2010 07:38:34 -0400 Subject: serious (for me) Xorg 7.5 mouse/kbd problem in 8.1-STABLE For years I have run Open-Motif on FreeBSD without issue. I use a USB keyboard and a USB three button mouse attached to a Dell Optiplex 960. This combination has worked fine for the past year. This week I upgraded from 8.0-STABLE circa January 2010 to 8.1-STABLE. I do this by doing a buildworld/installworld sequence after csup-ing stable-supfile and rebooting. In this case I also pkg_deleted all of my ports and am rebuilding them from source. Building Xorg is one of the very first ports I attempt since I prefer to work in xterms not virtual terminals. This upgrade moved me from Xorg 7.3 to Xorg 7.5, but Open-Motif stayed the same - open-motif-2.2.3_6 - it hasn't changed in years. After building Xorg, as root, I ran the "Xorg -configure" command to generate my xorg.conf.new file. Since a working /etc/X11/xorg.conf file was still around after the upgrade from 8.0-STABLE/Xorg 7.3, I felt no need to change anything in that file (later file comparisons confirmed that nothing had changed). My only relevant additions to /etc/X11/xorg.conf are these: Section "ServerFlags" Option "AutoAddDevices" "off" Option "DontZap" "false" EndSection In my /etc/rc.conf file I have dbus and hald enabled, and that has not changed since the beginning of 2010 after the confusion abated. As a normal user, I start Xorg using /usr/local/bin/xinit as always. I have several xterms configured in my ~/.xinitrc file. All those came up in the correct location and state. I was able to open those that started in iconic mode. In an open/raised xterm I could enter carriage returns and see my shell prompt move down the window. But when I tried to close/minimize an open/raised xterm, things failed. I use the following keyboard/mouse combination (configured in my .mwmrc file) to close (minimize) an xterm (and other applications): Shift window f.minimize This is also unchanged for some years. This particular setting has no bearing on the problem I came across yesterday. I merely state it for the record. However, this configuration triggers the "bug". The problem is as soon as I use that Shift/Btn3Click combination, my arrow cursor disappears, then I cannot move to or select other xterms - I am frozen, or locked, into the xterm I was trying to close/minimize. All I can do at this point is to kill(1) the /usr/local/bin/xinit command to return to the virtual terminal where I launched my Xorg session. I am now reluctantly using the good old /usr/local/bin/twm which is always built when Xorg is built from source. I am at a loss as to what to look for next. I suspect Xorg, or the keyboard and mouse driver, not the video driver, that came with. It might be a problem with hald(8), but again, I don't know how to debug this. Any help with this very odd bug would be greatly appreciated. ----- End forwarded message ----- This problem is known (and fixed) in newer versions of xorg-server. See this URL for details of the problem. I have also attached the changes I made to the dit/events.c file. After rebuilding xorg-server with those patches, the Open Motif (mwm) window manager now works with the above minimize keyboard and mouse squence. Thanks for all the help. Regards, web... -- William Bulley Email: web@umich.edu 72 characters width template ----------------------------------------->| --NzB8fVQJ5HfG6fxh Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename="patches.for.xorg.server.7.5" for (; grab; grab = grab->next) { DeviceIntPtr gdev; XkbSrvInfoPtr xkbi = NULL; /* 3471 Mask mask = 0; */ gdev= grab->modifierDevice; =*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*= } xE = &core; count = 1; /* 3586 mask = grab->eventMask; */ } else if (match & XI2_MATCH) { =*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*= count = 1; /* 3599 * FIXME: EventToXI2 returns NULL for enter events, so * dereferencing the event is bad. Internal event types are * aligned with core events, so the else clause is valid. * long-term we should use internal events for enter/focus * as well * if (xE) mask = grab->xi2mask[device->id][((xGenericEvent*)xE)->evtype/8]; else if (event->type == XI_Enter || event->type == XI_FocusIn) mask = grab->xi2mask[device->id][event->type/8]; */ } else { rc = EventToXI((InternalEvent*)event, &xE, &count); =*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*= "(%d, %d).\n", device->name, event->type, rc); continue; } /* 3618 mask = grab->eventMask; */ } (*grabinfo->ActivateGrab)(device, grab, currentTime, TRUE); =*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*= if (xE) { FixUpEventFromWindow(device, xE, grab->window, None, TRUE); /* 3627 TryClientEvents(rClient(grab), device, xE, count, mask, */ TryClientEvents(rClient(grab), device, xE, count, GetEventFilter(device, xE), GetEventFilter(device, xE), grab); } if (grabinfo->sync.state == FROZEN_NO_EVENT) --NzB8fVQJ5HfG6fxh--