Package Details: opensnap 0.1-1

Git Clone URL: https://aur.archlinux.org/opensnap.git (read-only, click to copy)
Package Base: opensnap
Description: Aero Snap Funcionality In Openbox
Upstream URL: https://github.com/lawl/opensnap
Submitter: deadhead
Maintainer: E5ten
Last Packager: E5ten
Votes: 4
Popularity: 0.000000
First Submitted: 2017-03-14 03:39 (UTC)
Last Updated: 2018-03-31 08:44 (UTC)

Dependencies (1)

Required by (0)

Sources (1)

Pinned Comments

E5ten commented on 2018-03-31 08:56 (UTC) (edited on 2018-03-31 15:06 (UTC) by E5ten)

To make unsnapping work replace <mousebind button="Left" action="Drag">...</mousebind> in <context name="Titlebar"> with

  <mousebind button="Left" action="Drag">
    <!-- Unsnap if snapped-->
    <action name="if">
      <maximizedvertical>yes</maximizedvertical>
      <then>
        <action name="Unmaximize"/>
          <direction>vertical</direction>
        <action name="MoveResizeTo">
          <x>center</x>
          <!-- we center windows in order to mitigate discrepancies 
          between window placement and mouse cursor -->
          <y>current</y>
        </action>
        <action name="Move"/>
      </then>
      <else>
        <action name="Move"/>
      </else>
    </action>
  </mousebind>

in ~/.config/openbox/rc.xml

Latest Comments

sinasina commented on 2023-12-29 19:10 (UTC) (edited on 2023-12-29 19:18 (UTC) by sinasina)

  <mousebind button="Left" action="Click">
    <!-- Unsnap if snapped-->
    <action name="if">
      <maximizedvertical>yes</maximizedvertical>
      <then>
        <action name="Unmaximize"/>
        <direction>vertical</direction>
       <action name="MoveResizeTo">
      <x>center</x>
      <y>center</y>
      <!-- if y axis is not centered there are problems with fullscreen unmaxi -->
   </action>
   </then>
   </action>
  </mousebind>

My suggestion is to use the above instead of the "Drag" snippets below. Instead of replacing the original

   <mousebind button="Left" action="Drag"> ... </mousebind>

Just paste it right below. (you can keep other left click actions in your config file untouched, so unshadow, focus etc will still work for regular non-snapped windows as they should)

Yes, it's less convenient to click like this, but there are advantages to this. The big one is that accidentally dragging windows out of bounds will not happen anymore. Also you get to drag the maximized window from left to right like on IOS. Overall this will behave very predictably without jankyness, it's not bad.

E5ten commented on 2018-03-31 08:56 (UTC) (edited on 2018-03-31 15:06 (UTC) by E5ten)

To make unsnapping work replace <mousebind button="Left" action="Drag">...</mousebind> in <context name="Titlebar"> with

  <mousebind button="Left" action="Drag">
    <!-- Unsnap if snapped-->
    <action name="if">
      <maximizedvertical>yes</maximizedvertical>
      <then>
        <action name="Unmaximize"/>
          <direction>vertical</direction>
        <action name="MoveResizeTo">
          <x>center</x>
          <!-- we center windows in order to mitigate discrepancies 
          between window placement and mouse cursor -->
          <y>current</y>
        </action>
        <action name="Move"/>
      </then>
      <else>
        <action name="Move"/>
      </else>
    </action>
  </mousebind>

in ~/.config/openbox/rc.xml

mechatrex commented on 2017-10-31 07:58 (UTC)

You have a typo in the dependencies it should be "wmctrl".