napcok / clicksnap

CTRL+click window snapping for Openbox/LXDE
17 stars 4 forks source link

[about mabox mousebind] Drag window to move, when window maximized. #2

Open samwhelp opened 1 year ago

samwhelp commented 1 year ago

I don't have account on Gitea, so i write here.

I create a sample for explaining this feature.

Drag window to move, when window maximized.

mabox / adjustment / mousebind

context Titlebar / orginal

  <mouse>
    <context name="Titlebar">
      <mousebind action="Drag" button="Left">
        <action name="Move"/>
      </mousebind>
    </context>
  </mouse>

context Titlebar / adjust

  <mouse>
    <context name="Titlebar">
      <mousebind action="Drag" button="Left">
        <action name="UnmaximizeFull"/>
        <action name="Move"/>
      </mousebind>
    </context>
  </mouse>

context Frame / orginal

  <mouse>
    <context name="Frame">
      <mousebind action="Drag" button="A-Left">
        <action name="Move"/>
      </mousebind>
    </context>
  </mouse>

context Frame / adjust

  <mouse>
    <context name="Frame">
      <mousebind action="Drag" button="A-Left">
        <action name="UnmaximizeFull"/>
        <action name="Move"/>
      </mousebind>
    </context>
  </mouse>
samwhelp commented 1 year ago

reference

I create another sample for enhance.

mabox / adjustment / mousebind

Drag window to move, when window maximized.

context Titlebar / orginal

  <mouse>
    <context name="Titlebar">
      <mousebind action="Drag" button="Left">
        <action name="Move"/>
      </mousebind>
    </context>
  </mouse>

context Titlebar / adjust

  <mouse>
    <context name="Titlebar">
      <mousebind action="Drag" button="Left">
        <action name="if">
          <maximized>yes</maximized>
          <then>
            <action name="UnmaximizeFull"/>
            <action name="MoveResizeTo">
              <x>center</x>
              <y>current</y>
            </action>
            <action name="Move"/>
          </then>
          <else>
            <action name="Move"/>
          </else>
        </action>
      </mousebind>
    </context>
  </mouse>

context Frame / orginal

  <mouse>
    <context name="Frame">
      <mousebind action="Drag" button="A-Left">
        <action name="Move"/>
      </mousebind>
    </context>
  </mouse>

context Frame / adjust

  <mouse>
    <context name="Frame">
      <mousebind action="Drag" button="A-Left">
        <action name="if">
          <maximized>yes</maximized>
          <then>
            <action name="UnmaximizeFull"/>
            <action name="MoveResizeTo">
              <x>center</x>
              <y>current</y>
            </action>
            <action name="Move"/>
          </then>
          <else>
            <action name="Move"/>
          </else>
        </action>
      </mousebind>
    </context>
  </mouse>
napcok commented 1 year ago

I will apply those changes. Thank you very much :)