Skip to content

placemouse

bakkeby edited this page Jul 1, 2024 · 6 revisions

This patch allow the user to change the position of a client in the stack by using the mouse.

Features

  • supports moving clients across monitors

placemouse.gif

Options

The patch comes with a few options that has to do with how and when the selected client takes the place of the client beneath it.

These are in form of integers that are passed as the argument value to the moveorplace function and in the following example the value of 1 is passed:

	{ ClkClientWin,         MODKEY,                Button1,    moveorplace,    {.i = 1} },

The options and what they do can be summarised as:

  • 0 - tiled position is relative to mouse cursor
  • 1 - tiled postiion is relative to window center
  • 2 - mouse pointer warps to window center

So if the value of 0 is used as the argument then the client underneath the mouse cursor is the one which will be adjacent to the selected client.

If the value of 1 is used then the client underneath the center of the selected client will be the adjacent one. This generally has a good feel to it and works well, but has a minor caveat where if the client is very large then you may not be able to position it as freely because the mouse cursor can't go past the monitor edge.

If the value of 2 is used then the cursor is warped to the client center making it a combination of the other two alternatives. In practice though the the client warps to the cursor's position when it snaps out of the tiled position.

Experiment with the three to work out what works best for you.

The moveorplace function simply forwards the action to movemouse or placemouse depending on the floating state of the client. Arguably it makes moving clients around more intuitive and as such it replaces the movemouse key binding in the patch. If you prefer to retain the feature of moving a tiled client into a floating position then you can set up separate key bindings for movemouse and placemouse.

Determining whether to attach above or below a given client

As for how the patch decides whether to attach the selected client before or after the one underneath the cursor (or the selected client's midpoint) imagine the the target client being split diagonally like this with attaching above in the top left area and below in the bottom right area.

 ___________________
| above           . |
|             .     |
|         .         |
|     .             |
| .           below |
|___________________|

It was implemented like this to make the behaviour more intuitive while at the same time being layout agnostic (i.e. not needing to know whether clients are tiled horizontally or vertically).

Download

Clone this wiki locally