在Lubuntu中使用滚轮禁用桌面切换?


Answers:


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

(这将创建一个备份文件,以便当您认为已将其弄乱时,可以将其还原。)

leafpad lubuntu-rc.xml

并删除显示以下内容的行;

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

注销并再次登录以查看更改!

如果您搞砸了,想将其还原回来;

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

Lubuntu文档引用的答案


11

从Lubuntu 14.04或更早版本开始,配置文件格式和解决方案与@SWrobel的answer略有不同。然后在Ubuntu 17.10(或更早版本)中,情况又发生变化。

以下说明适用于当前情况(Ubuntu 17.10及更高版本)。

  1. 删除以下行~/.config/openbox/lubuntu-rc.xml以禁用带有和不带有修饰键的窗口中的任何滚轮桌面切换。(不过请保留外部<context …> … </context>元素。)

    <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. 还删除以下几行以禁用桌面背景上的任何滚轮桌面切换:

    <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. 还要删除以下几行,以在移动窗口时禁用任何滚轮桌面切换:

    <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. 执行此操作,以使设置立即生效():

    openbox --reconfigure
    

1

我发现当鼠标悬停在裸露的桌面上时不小心移动滚轮会导致我的窗口消失,并切换到使用Lubuntu 18.04的新桌面。这不是我想要的。我通过查看发现了解决方法:

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

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

我用nano编辑了lubuntu-rs.xml:

nano lubuntu-rc.xml

我在文件中找到了以下几行:

<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>

我删除了除第一行以外的所有这些行,保存了更改并退出了nano。我通过以下方法使这些更改生效:

openbox –-reconfigure

在裸机上移动鼠标滚轮不再更改台式机,但是仍然可以更改台式机,例如,通过单击lxpanel上的相应图标。

更简单地说,如果您不想使用多个桌面,则将桌面数量设置为一个即可解决此问题。

By using our site, you acknowledge that you have read and understand our Cookie Policy and Privacy Policy.
Licensed under cc by-sa 3.0 with attribution required.