Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Adjustment] Drag window to move, when window maximized #8

Closed
samwhelp opened this issue Jan 2, 2023 · 1 comment
Closed

[Adjustment] Drag window to move, when window maximized #8

samwhelp opened this issue Jan 2, 2023 · 1 comment

Comments

@samwhelp
Copy link

samwhelp commented Jan 2, 2023

[Adjustment] Drag window to move, when window maximized

Drag window to move, when window maximized.

According archcraft-openbox / rc.xml

I create a sample for explaining this feature.

archcraft-openbox / adjustment / mousebind

context Titlebar / orginal

  <mouse>
    <context name="Titlebar">

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

      <mousebind action="Drag" button="Left">
        <action name="if">
          <maximizedvertical>yes</maximizedvertical>
          <then>
            <action name="Unmaximize"/>
            <direction>vertical</direction>
            <action name="MoveResizeTo">
              <x>center</x>
              <y>current</y>
            </action>
            <action name="Move"/>
          </then>
          <else>
            <action name="Move"/>
          </else>
        </action>
      </mousebind>

    </context>
  </mouse>

context Titlebar / adjust

  <mouse>
    <context name="Titlebar">

      <!--
      <mousebind action="Drag" button="A-Left">
        <action name="Move"/>
      </mousebind>
      //-->

      <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="W-Left">
        <action name="Move"/>
      </mousebind>
    </context>
  </mouse>

context Frame / adjust

  <mouse>
    <context name="Frame">
      <!--
      <mousebind action="Drag" button="W-Left">
        <action name="Move"/>
      </mousebind>
      //-->
      <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>

Link

@adi1090x
Copy link
Member

adi1090x commented Apr 3, 2024

That's the default behavior already. Just some extra code here for config file.

@adi1090x adi1090x closed this as completed Apr 3, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants