use current workspace in ClientPattern when client has no FbWindow

This commit is contained in:
Mark Tiefenbruck 2009-06-25 03:18:27 -07:00
parent ed28c69b8d
commit 02e0f9321c

View file

@ -378,17 +378,16 @@ string ClientPattern::getProperty(WinProperty prop, const Focusable &client) {
return (fbwin && fbwin->isIconHidden()) ? "yes" : "no";
break;
case WORKSPACE: {
if (!fbwin)
return "";
unsigned int wsnum = (fbwin ? fbwin->workspaceNumber() : client.screen().currentWorkspaceID());
char tmpstr[128];
sprintf(tmpstr, "%d", fbwin->workspaceNumber());
sprintf(tmpstr, "%d", wsnum);
return std::string(tmpstr);
break;
}
case WORKSPACENAME: {
if (!fbwin)
return "";
const Workspace *w = client.screen().getWorkspace(fbwin->workspaceNumber());
const Workspace *w = (fbwin ?
client.screen().getWorkspace(fbwin->workspaceNumber()) :
client.screen().currentWorkspace());
return w ? w->name() : "";
break;
}