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:
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?
Best Answer
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
65,24
you mention, are the width of the Unity Launcher and the height of your panel.In the line:
in the output of
wmctrl -lG
, you can see that the Launcher is positioned atx=0, y=24
, while the size of the launcher is65 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:
and not:
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):or
Reading the output of
wmctrl -dG
Looking at the
1792x1111
inWA: 65,24 1792x1111
, you can see that you have a monitor resolution of1857
(65
+1792
) x1135
(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).Summarizing
Both
wmctrl
andxdotool
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
andUnity
is the deviation, as described in this one.