summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/Remember.cc16
1 files changed, 8 insertions, 8 deletions
diff --git a/src/Remember.cc b/src/Remember.cc
index 2191a94..b22d62a 100644
--- a/src/Remember.cc
+++ b/src/Remember.cc
@@ -21,7 +21,7 @@
21// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER 21// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
22// DEALINGS IN THE SOFTWARE. 22// DEALINGS IN THE SOFTWARE.
23 23
24// $Id: Remember.cc,v 1.20 2003/05/31 01:07:36 rathnor Exp $ 24// $Id: Remember.cc,v 1.21 2003/06/05 13:20:05 fluxgen Exp $
25 25
26#include "Remember.hh" 26#include "Remember.hh"
27#include "StringUtil.hh" 27#include "StringUtil.hh"
@@ -125,19 +125,19 @@ FbTk::Menu *createRememberMenu(Remember &remember, FluxboxWindow &win) {
125 return menu; 125 return menu;
126}; 126};
127 127
128const char * getWMClass(Window w) { 128std::string getWMClass(Window w) {
129 XClassHint ch; 129 XClassHint ch;
130 130
131 if (XGetClassHint(FbTk::App::instance()->display(), w, &ch) == 0) { 131 if (XGetClassHint(FbTk::App::instance()->display(), w, &ch) == 0) {
132 cerr<<"Failed to read class hint!"<<endl; 132 cerr<<"Failed to read class hint!"<<endl;
133 return 0; 133 return 0;
134 } else { 134 } else {
135 string m_instance_name; 135 string instance_name;
136 if (ch.res_name != 0) { 136 if (ch.res_name != 0) {
137 m_instance_name = const_cast<char *>(ch.res_name); 137 instance_name = const_cast<char *>(ch.res_name);
138 XFree(ch.res_name); 138 XFree(ch.res_name);
139 } else 139 } else
140 m_instance_name = ""; 140 instance_name = "";
141 141
142 if (ch.res_class != 0) { 142 if (ch.res_class != 0) {
143 //m_class_name = const_cast<char *>(ch.res_class); 143 //m_class_name = const_cast<char *>(ch.res_class);
@@ -145,7 +145,7 @@ const char * getWMClass(Window w) {
145 } else { 145 } else {
146 //m_class_name = ""; 146 //m_class_name = "";
147 } 147 }
148 return m_instance_name.c_str(); 148 return instance_name.c_str();
149 } 149 }
150} 150}
151 151
@@ -177,11 +177,11 @@ Application* Remember::add(const char* app_name) {
177} 177}
178 178
179Application* Remember::find(WinClient &winclient) { 179Application* Remember::find(WinClient &winclient) {
180 return find(getWMClass(winclient.window())); 180 return find(getWMClass(winclient.window()).c_str());
181} 181}
182 182
183Application* Remember::add(WinClient &winclient) { 183Application* Remember::add(WinClient &winclient) {
184 return add(getWMClass(winclient.window())); 184 return add(getWMClass(winclient.window()).c_str());
185} 185}
186 186
187 187