aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorrathnor <rathnor>2003-04-27 15:53:53 (GMT)
committerrathnor <rathnor>2003-04-27 15:53:53 (GMT)
commit1e145051c7f7eb680ac28a1a869cb17a8a21daf5 (patch)
tree7b11ff9e88c28ad4dae3cc374439ebb32ec01d0f
parentf28ac3b625558cffd63dbf7221967f9fc21627d0 (diff)
downloadfluxbox-1e145051c7f7eb680ac28a1a869cb17a8a21daf5.zip
fluxbox-1e145051c7f7eb680ac28a1a869cb17a8a21daf5.tar.bz2
fix remember to match on instance rather than class name
Also make remember menu appear on transients, only disabled
-rw-r--r--src/Remember.cc33
1 files changed, 20 insertions, 13 deletions
diff --git a/src/Remember.cc b/src/Remember.cc
index d92b4ec..cbd8f59 100644
--- a/src/Remember.cc
+++ b/src/Remember.cc
@@ -20,7 +20,7 @@
20// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER 20// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
21// DEALINGS IN THE SOFTWARE. 21// DEALINGS IN THE SOFTWARE.
22 22
23// $Id: Remember.cc,v 1.8 2003/04/26 18:56:39 fluxgen Exp $ 23// $Id: Remember.cc,v 1.9 2003/04/27 15:53:53 rathnor Exp $
24 24
25#include "Remember.hh" 25#include "Remember.hh"
26#include "StringUtil.hh" 26#include "StringUtil.hh"
@@ -135,20 +135,20 @@ const char * getWMClass(Window w) {
135 cerr<<"Failed to read class hint!"<<endl; 135 cerr<<"Failed to read class hint!"<<endl;
136 return 0; 136 return 0;
137 } else { 137 } else {
138 string m_class_name; 138 string m_instance_name;
139 if (ch.res_name != 0) { 139 if (ch.res_name != 0) {
140 //m_instance_name = const_cast<char *>(ch.res_name); 140 m_instance_name = const_cast<char *>(ch.res_name);
141 XFree(ch.res_name); 141 XFree(ch.res_name);
142 } else {} 142 } else
143 //m_instance_name = ""; 143 m_instance_name = "";
144 144
145 if (ch.res_class != 0) { 145 if (ch.res_class != 0) {
146 m_class_name = const_cast<char *>(ch.res_class); 146 //m_class_name = const_cast<char *>(ch.res_class);
147 XFree(ch.res_class); 147 XFree(ch.res_class);
148 } else { 148 } else {
149 m_class_name = ""; 149 //m_class_name = "";
150 } 150 }
151 return m_class_name.c_str(); 151 return m_instance_name.c_str();
152 } 152 }
153} 153}
154 154
@@ -543,6 +543,18 @@ void Remember::forgetAttrib(WinClient &winclient, Attribute attrib) {
543void Remember::setupWindow(FluxboxWindow &win) { 543void Remember::setupWindow(FluxboxWindow &win) {
544 WinClient &winclient = win.winClient(); 544 WinClient &winclient = win.winClient();
545 545
546 // we don't touch the window if it is a transient
547 // of something else
548 if (winclient.transientFor()) {
549 // still put something in the menu so people don't get confused
550 // so, we add a disabled item...
551 FbTk::MenuItem *item = new FbTk::MenuItem("Remember...");
552 item->setEnabled(false);
553 win.getWindowmenu().insert(item, win.getWindowmenu().numberOfItems()-2);
554 win.getWindowmenu().update();
555 return;
556 }
557
546 // add the menu, this -2 is somewhat dodgy... :-/ 558 // add the menu, this -2 is somewhat dodgy... :-/
547 // All windows get the remember menu. 559 // All windows get the remember menu.
548 // TODO: nls 560 // TODO: nls
@@ -551,11 +563,6 @@ void Remember::setupWindow(FluxboxWindow &win) {
551 win.getWindowmenu().numberOfItems()-2); 563 win.getWindowmenu().numberOfItems()-2);
552 win.getWindowmenu().update(); 564 win.getWindowmenu().update();
553 565
554 // we don't touch the window if it is a transient
555 // of something else
556 if (winclient.transientFor())
557 return;
558
559 Application *app = find(winclient); 566 Application *app = find(winclient);
560 if (!app) return; // nothing to do 567 if (!app) return; // nothing to do
561 568