From 02e0f9321cce4f331ce2523621830e3102c04493 Mon Sep 17 00:00:00 2001 From: Mark Tiefenbruck Date: Thu, 25 Jun 2009 03:18:27 -0700 Subject: use current workspace in ClientPattern when client has no FbWindow --- src/ClientPattern.cc | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/src/ClientPattern.cc b/src/ClientPattern.cc index 6a19f2f..72bf161 100644 --- a/src/ClientPattern.cc +++ b/src/ClientPattern.cc @@ -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; } -- cgit v0.11.2