OpenBox Mouse binding for dragging window to screen edge

.rclxdemouse-gesturesopenboxtiling-wm

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!

Best Answer

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