<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Gen X Design &#124; Ian Selby &#187; mouse</title>
	<atom:link href="http://www.gen-x-design.com/tags/mouse/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.gen-x-design.com</link>
	<description>Just another WordPress weblog</description>
	<lastBuildDate>Fri, 15 Jan 2010 21:41:43 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.8</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Workaround for Ubuntu 8.10 mouse bug</title>
		<link>http://www.gen-x-design.com/archives/workaround-for-ubuntu-810-mouse-bug/</link>
		<comments>http://www.gen-x-design.com/archives/workaround-for-ubuntu-810-mouse-bug/#comments</comments>
		<pubDate>Tue, 20 Jan 2009 22:41:41 +0000</pubDate>
		<dc:creator>Davey</dc:creator>
				<category><![CDATA[General]]></category>
		<category><![CDATA[Ubuntu]]></category>
		<category><![CDATA[mouse]]></category>
		<category><![CDATA[nvidia]]></category>
		<category><![CDATA[xinerama]]></category>
		<category><![CDATA[xorg]]></category>

		<guid isPermaLink="false">http://www.gen-x-design.com/?p=179</guid>
		<description><![CDATA[Ubuntu 8.10 has a massive bug in the xorg window code at the moment. Originally reported in November when 8.10 shipped, the lack of action on this is kind of unusual for the generally excellent Linux community.
However I&#8217;ve worked out a minimally intrusive hacktastic workaround. What seems to be happening with this bug is sometimes [...]]]></description>
			<content:encoded><![CDATA[<p>Ubuntu 8.10 has a <a title="Launchpad Bug Report" href="https://bugs.launchpad.net/ubuntu/+bug/296167">massive bug</a> in the xorg window code at the moment. Originally reported in November when 8.10 shipped, the lack of action on this is kind of unusual for the generally excellent Linux community.</p>
<p>However I&#8217;ve worked out a minimally intrusive hacktastic workaround. <span id="more-179"></span>What seems to be happening with this bug is sometimes when X traffic is moving from one GPU to the other (this only affect multi video card setups) it causes the mouse hardware to get disconnected from the internal desktop model so X thinks the mouse is somewhere else and nothing works. The problem only affects configurations using &gt;2 monitors using  xinerama, the currently suggested fixes are either to downgrade to the Hardy version of Xorg, which has pretty poor xinerama performance or to follow a strange set of keyboard based window movements until the problem disappears.</p>
<p>My fix is to use some nifty Linux tools and a bit of Gnome fu to get the two to be in agreement again.</p>
<p>First you need to install xautomation,</p>
<blockquote><p><strong>Control X from the command line, and find things on the screen</strong><br />
Control X from the command line for scripts, and do &#8220;visual scraping&#8221; to<br />
find things on the screen. The control interface allows mouse movement,<br />
clicking, button up/down, key up/down, etc, and uses the XTest extension so<br />
you don&#8217;t have the annoying problems that xse has when apps ignore sent<br />
events. The visgrep program find images inside of images and reports the<br />
coordinates, allowing programs to find buttons, etc, on the screen to click<br />
on.</p></blockquote>
<p>The install as usual is trivial (gotta love dat package management)</p>
<pre>sudo apt-get install xautomation</pre>
<p>OK now you have xautomation, the command we are going to use will locate the mouse pointer at the origin (0,0) of the desktop, and doing this seems to re-align the mouse and X.</p>
<pre>xte "mousemove 0 0"</pre>
<p>really it&#8217;s that simple. [edit - well of not really, turns out some folks need to move the mouse onto the primary display and off again, just add a second mousemove line with co-ords for your second display]</p>
<p>So you could just type this into a terminal when the mouse borks and that would be good enough to repair, but who can really be bothered with all that malarkey, as this is happening to me every couple of hours, I dont want to be reminded how messed up my Ubuntu install is and have to  learn all the window navigation keystrokes needed to pop a terminal without a mouse, although with <a title="This is not QuickSilver!" href="http://do.davebsd.com/">Gnome-do</a> (the Gnome version of  quicksilver) it&#8217;s kinda easy.</p>
<p>so create a script to run the command.</p>
<pre>echo xte "mousemove 0 0" &gt; mm.sh
chmod 777 mm.sh</pre>
<p>Running the script will move the cursor as we want, so now we need to assign this to a hot-key. Gnome desktop doesn&#8217;t give you a particularly easy way to do this, so you have to run the Gnome Configuration Editor, which is sort of like a regedit for gnome apps.</p>
<pre>gconf-editor</pre>
<p>That will bring up the Gnome Configuration Editor, If you&#8217;ve ever messed with the Windows registry this will be reasonably familiar. To set up the hotkey we need to edit two entries, the first to register the script, the second to assign the hotkey.</p>
<p>Navigate to<strong> apps/metacity/keybinding_commands</strong> and enter the path to the mm.sh script we created earlier in one of the available slots. I&#8217;m using the command_1 slot, you can choose any of the 12 available slots.</p>
<div style="text-align: center; margin-top: 10px;"><img class="aligncenter size-full wp-image-191" src="http://www.gen-x-design.com/wp-content/uploads/2009/01/screenshot-configuration-editor-keybinding_commands.png" alt="screenshot-configuration-editor-keybinding_commands" width="523" height="339" /></div>
<p>Now navigate to <strong>apps/metacity/global_keybindings</strong> and set the matching  run_command key-binding to the value for the hotkey you want to run the script. The values for this are a string, and the tokens &lt;Control&gt; &lt;Shift&gt; &lt;Alt&gt; &lt;Super&gt; are used for the special combo keys. In my case I&#8217;m using &lt;Super&gt;M, which will be either the Window or the Command key depending on the keyboard your are using.</p>
<div style="text-align: center; margin-top: 10px;"><img class="aligncenter size-full wp-image-194" src="http://www.gen-x-design.com/wp-content/uploads/2009/01/screenshot-configuration-editor-global_keybindings.png" alt="screenshot-configuration-editor-global_keybindings" width="543" height="381" /></div>
<p>So if it all works according to plan, the script will be attached to the Super-M key combo, so if your mouse locks, pressing Super-M will repair the damage and let you carry on.</p>
<p>This will hopefully tide you over until the Xorg bug is fixed or nvidia release the forthcoming SLI support that will allow &gt;2 monitors to be used without having to use xinerama.</p>
<p>enjoy.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.gen-x-design.com/archives/workaround-for-ubuntu-810-mouse-bug/feed/</wfw:commentRss>
		<slash:comments>7</slash:comments>
		</item>
	</channel>
</rss>

