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"; return (fbwin && fbwin->isIconHidden()) ? "yes" : "no";
break; break;
case WORKSPACE: { case WORKSPACE: {
if (!fbwin) unsigned int wsnum = (fbwin ? fbwin->workspaceNumber() : client.screen().currentWorkspaceID());
return "";
char tmpstr[128]; char tmpstr[128];
sprintf(tmpstr, "%d", fbwin->workspaceNumber()); sprintf(tmpstr, "%d", wsnum);
return std::string(tmpstr); return std::string(tmpstr);
break; break;
} }
case WORKSPACENAME: { case WORKSPACENAME: {
if (!fbwin) const Workspace *w = (fbwin ?
return ""; client.screen().getWorkspace(fbwin->workspaceNumber()) :
const Workspace *w = client.screen().getWorkspace(fbwin->workspaceNumber()); client.screen().currentWorkspace());
return w ? w->name() : ""; return w ? w->name() : "";
break; break;
} }