12

I still want to keep my multiple desktops, I want to disable switching desktops with the mouse.

9
cd ~/.config/openbox
cp lubuntu-rc.xml lubuntu-rc.xml.bak

(this makes a backup file so that when you think you've messed it up you could revert it back.)

leafpad lubuntu-rc.xml

and delete the lines which says;

<mousebind button="UP" action="click">
 <action name="DesktopPrevious" />
<mousebind button="Down" action="click">
 <action name="DesktopNext" />

Log out and Log in back again to see the changes!

if you've messed it up and want to revert it back;

cp lubuntu-rc.xml.bak lubuntu-rc.xml

Answer quoted from Lubuntu docs

10

Starting with Lubuntu 14.04 or earlier, the config file format and answer is now slightly different from @SWrobel's answer. It became different again in Ubuntu 17.10 or earlier. The following instructions have been updated to Ubuntu 17.10:

  1. Remove the following lines from ~/.config/openbox/lubuntu-rc.xml to disable any scroll wheel desktop switching in a window, with and without modifier keys. (Keep the outer <context …> … </context> element though.)

    <context name="Frame">
      […]
      <mousebind button="A-Up" action="Click">
        <action name="GoToDesktop">
          <to>previous</to>
        </action>
      </mousebind>
      <mousebind button="A-Down" action="Click">
        <action name="GoToDesktop">
          <to>next</to>
        </action>
      </mousebind>
      <mousebind button="C-A-Up" action="Click">
        <action name="GoToDesktop">
          <to>previous</to>
        </action>
      </mousebind>
      <mousebind button="C-A-Down" action="Click">
        <action name="GoToDesktop">
          <to>next</to>
        </action>
      </mousebind>
      <mousebind button="A-S-Up" action="Click">
        <action name="SendToDesktop">
          <to>previous</to>
        </action>
      </mousebind>
      <mousebind button="A-S-Down" action="Click">
        <action name="SendToDesktop">
          <to>next</to>
        </action>
      </mousebind>
    </context>
    
  2. Also remove the following lines to disable any scroll wheel desktop switching on the desktop background:

    <context name="Desktop">
      <mousebind button="A-Up" action="Click">
        <action name="GoToDesktop">
          <to>previous</to>
        </action>
      </mousebind>
      <mousebind button="A-Down" action="Click">
        <action name="GoToDesktop">
          <to>next</to>
        </action>
      </mousebind>
      <mousebind button="C-A-Up" action="Click">
        <action name="GoToDesktop">
          <to>previous</to>
        </action>
      </mousebind>
      <mousebind button="C-A-Down" action="Click">
        <action name="GoToDesktop">
          <to>next</to>
        </action>
      </mousebind>
      <mousebind button="Left" action="Press">
        <action name="Focus"/>
        <action name="Raise"/>
      </mousebind>
      <mousebind button="Right" action="Press">
        <action name="Focus"/>
        <action name="Raise"/>
      </mousebind>
    </context>
    
  3. Also remove the following lines to disable any scroll wheel desktop switching while moving a window around:

    <context name="MoveResize">
      <mousebind button="Up" action="Click">
        <action name="GoToDesktop">
          <to>previous</to>
        </action>
      </mousebind>
      <mousebind button="Down" action="Click">
        <action name="GoToDesktop">
          <to>next</to>
        </action>
      </mousebind>
      <mousebind button="A-Up" action="Click">
        <action name="GoToDesktop">
          <to>previous</to>
        </action>
      </mousebind>
      <mousebind button="A-Down" action="Click">
        <action name="GoToDesktop">
          <to>next</to>
        </action>
      </mousebind>
    </context>
    
  4. Execute this to let the settings take effect immediately (source):

    openbox --reconfigure
    
0

I found that inadvertently moving the scroll wheel when my mouse was over bare desktop caused my windows to disappear and a switch to a new desktop with Lubuntu 18.04. This was not what I wanted. I found out how to fix this by looking at:

http://openbox.org/wiki/Help:Bindings

cd ~/.config/openbox
cp lubuntu-rc.xml lubuntu-rc.xml.bak

I edited lubuntu-rs.xml with nano:

nano lubuntu-rc.xml

I found these lines within the file:

<context name="Desktop">
  <mousebind button="Up" action="Click">
    <action name="GoToDesktop">
      <to>previous</to>
    </action>
  </mousebind>
  <mousebind button="Down" action="Click">
    <action name="GoToDesktop">
      <to>next</to>
    </action>

I deleted all these lines except the first one, saved the changes and exited from nano. I made these changes effective with:

openbox –-reconfigure

Moving mouse scroll wheel over bare desktop no longer changed desktops, but it was still possible to change desktops, e.g. by clicking on the corresponding icons on the lxpanel.

More simply, if you do not want to use multiple desktops, setting the number of desktops to one fixes the problem.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.