Fix workspace renaming with Ctrl+left click
commited115929f3da52f494f3ff98a16a56f7dc5a3dd0
authorCarlos R. Mafra <crmafra@gmail.com>
Fri, 7 Jun 2013 13:32:07 +0000 (7 14:32 +0100)
committerCarlos R. Mafra <crmafra@gmail.com>
Fri, 7 Jun 2013 13:32:07 +0000 (7 14:32 +0100)
tree0bc7b077757d35436dd28dac73e434a42f24106c
parent5455a585dc86cebd666ea41499519ea18e6172f0
Fix workspace renaming with Ctrl+left click

The Workspaces entry in the main menu allows to rename workspaces by
clicking on the workspace name while pressing the Ctrl key.

However since commit 63219247c6c7 ("Added shortcut to switch to last used workspace")
there is one more entry before the workspace name list, and that leads to
picking a wrong name to rename -- clicking on the first workspace asks to
rename the second workspace and so forth. Trying to rename the last workspace
leads to a segfault.

This happens because there is an explicit offset in the current code (- 2)
to account for the "non-workspace" entries in the menu. If one adds one
more entry that offset should be changed too (this is a prime example
of fragile code leading to bugs).
src/menu.c