I've been playing around with wmctrl to take more control of my windows. I've encountered a weird behaviour where Unity reserves double the space.
See this screen shot:

enter image description here

I opened the terminal and moved the window using the top command. It should be at the top left corner (X=0 Y=0). But for some reason there is some margin between the terminal and the Unity bars.

If I understand the man pages correctly it might have something to do with the WA: 65,24.

Can anybody help me to fix this?


Probably not the answer you were looking for:

Issues with the combination of Unity and wmctrl

The combination of Unity and wmctrl unfortunately has a few peculiarities, of which the behaviour you describe is one.

Looking at your output

  • The 65,24 you mention, are the width of the Unity Launcher and the height of your panel.
  • In the line:

    0x03400005  0 0   24    65   1111  janw_VirtualBox unity-launcher

    in the output of wmctrl -lG, you can see that the Launcher is positioned at x=0, y=24, while the size of the launcher is 65 x 1111. (1111 is the height of your screen minus the height of your panel)

Strictly, the command to place the active window in the top left corner should therefore be:

wmctrl -r :ACTIVE: -e 0,65,24,1500,550

and not:

wmctrl -r :ACTIVE: -e 0,0,0,1500,550

However, this will not solve the issue, it simply is a bug. There still will be the marge you describe. The same will happen by the way when using xdotool (not installed by default):

xdotool windowmove "$(xdotool getactivewindow)"  65 24


xdotool windowmove "$(xdotool getactivewindow)"  0 0

Reading the output of wmctrl -dG

Looking at the 1792x1111 in WA: 65,24 1792x1111, you can see that you have a monitor resolution of 1857 (65+1792) x 1135 (1111+24).
In this case, it matches exactly the values in DG: 1857x1135, since you only have one viewport (workspace): DG stands for the total size of your desktop (all viewports).


Both wmctrl and xdotool work fine if you set a window maximized. The effect you describe will not occur. Moving or resizing windows will however leave a few pixels from both the launcher and the panel, as described in this answer.:
"The window to be moved/re-sized needs to be at least a few px from both the Unity launcher and the top panel."

Apart from what you describe, another issue you will run into if you start playing around with wmctrl and Unity is the deviation, as described in this one.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.