6

I am trying to edit the lxde-rc.xml file (in ~/.config/openbox) so I can implement Window snapping like in Microsoft Windows. When a window is dragged to the right edge of the screen, it maximizes to fill the right half of the screen. I don't want to use a tiling wm, but edit the configuration for openbox. I have found code that will do this with keyboard shortcuts:

<!-- Fill left half of desktop -->
<keybind key="C-W-Left">
<action name="Unmaximize"/>
<action name="MoveResizeTo">
<x>0</x>
<y>0</y>
<height>99%</height>
<width>50%</width>
</action>
</keybind>
<!-- Fill right half of desktop -->
<keybind key="C-W-Right">
<action name="Unmaximize"/>
<action name="MoveResizeTo">
<x>-0</x>
<y>0</y>
<height>99%</height>
<width>50%</width>
</action>
</keybind>

My current (and also the default) configuration moves a window to the next desktop when it is dragged to the screen edge, so there must already be some kind of binding in the configuration file. However, The only actions in the configuration file that switch desktops are called by Keyboard shortcuts and scrolling on the desktop.

I have two questions:

What would a mouse binding look like that toggles an action when a window is dragged to the edge of the screen, and:

Why is the current behaviour of that action not referenced in lxde-rc.xml?

Thanks in advance!

1 Answer 1

1

Mouse binding to toggle an action when dragging to screen edge: There doesn't seem to be an obvious way to have Openbox detect dragging a window to the edge of the screen as a <mousebind> action. It might be easiest to basically set up hot corners, such as with behave_screen_edge in xdotool, and use those to trigger the Openbox keybind you've already found.

What makes Openbox send windows to other desktops by dragging them to the screen edge? This is set up in <screenEdgeWarpTime>. Example from my rc.xml, in the <mouse> section:

  <screenEdgeWarpTime>400</screenEdgeWarpTime>
  <!-- Time before changing desktops when the pointer touches the edge of the
       screen while moving a window, in milliseconds (1000 = 1 second).
       Set this to 0 to disable warping -->
1
  • Thanks for the alternative solution, but the screenEdgeWarpTime only sets a time. Aparrently the action itself is not called with a binding from rc.xml, but from somewhere else. Commented Aug 26, 2015 at 14:59

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .