aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/Remember.cc65
-rw-r--r--src/Remember.hh2
-rw-r--r--src/Screen.cc2
-rw-r--r--src/Screen.hh4
-rw-r--r--src/Window.cc6
5 files changed, 39 insertions, 40 deletions
diff --git a/src/Remember.cc b/src/Remember.cc
index 62c0d18..2b8fbce 100644
--- a/src/Remember.cc
+++ b/src/Remember.cc
@@ -290,6 +290,32 @@ Remember::~Remember() {
290 s_instance = 0; 290 s_instance = 0;
291} 291}
292 292
293int Remember::getDecoFromString(const string &str_label) {
294 if (strcasecmp(str_label.c_str(), "NONE") == 0)
295 return 0;
296 if (strcasecmp(str_label.c_str(), "NORMAL") == 0)
297 return FluxboxWindow::DECORM_LAST - 1;
298 if (strcasecmp(str_label.c_str(), "TINY") == 0)
299 return FluxboxWindow::DECORM_TITLEBAR
300 | FluxboxWindow::DECORM_ICONIFY
301 | FluxboxWindow::DECORM_MENU
302 | FluxboxWindow::DECORM_TAB;
303 if (strcasecmp(str_label.c_str(), "TOOL") == 0)
304 return FluxboxWindow::DECORM_TITLEBAR
305 | FluxboxWindow::DECORM_MENU;
306 if (strcasecmp(str_label.c_str(), "BORDER") == 0)
307 return FluxboxWindow::DECORM_BORDER
308 | FluxboxWindow::DECORM_MENU;
309 if (strcasecmp(str_label.c_str(), "TAB") == 0)
310 return FluxboxWindow::DECORM_BORDER
311 | FluxboxWindow::DECORM_MENU
312 | FluxboxWindow::DECORM_TAB;
313 unsigned int mask;
314 if (getuint(str_label.c_str(), mask))
315 return mask;
316 return -1;
317}
318
293Application* Remember::find(WinClient &winclient) { 319Application* Remember::find(WinClient &winclient) {
294 // if it is already associated with a application, return that one 320 // if it is already associated with a application, return that one
295 // otherwise, check it against every pattern that we've got 321 // otherwise, check it against every pattern that we've got
@@ -448,40 +474,11 @@ int Remember::parseApp(ifstream &file, Application &app, string *first_line) {
448 app.rememberIconHiddenstate((strcasecmp(str_label.c_str(), "yes") == 0)); 474 app.rememberIconHiddenstate((strcasecmp(str_label.c_str(), "yes") == 0));
449 app.rememberFocusHiddenstate((strcasecmp(str_label.c_str(), "yes") == 0)); 475 app.rememberFocusHiddenstate((strcasecmp(str_label.c_str(), "yes") == 0));
450 } else if (strcasecmp(str_key.c_str(), "Deco") == 0) { 476 } else if (strcasecmp(str_key.c_str(), "Deco") == 0) {
451 if (strcasecmp(str_label.c_str(), "NONE") == 0) { 477 int deco = getDecoFromString(str_label);
452 app.rememberDecostate((unsigned int) 0); 478 if (deco == -1)
453 } else if (strcasecmp(str_label.c_str(), "NORMAL") == 0) { 479 had_error = 1;
454 app.rememberDecostate((unsigned int) 0xfffffff); 480 else
455 } else if (strcasecmp(str_label.c_str(), "TINY") == 0) { 481 app.rememberDecostate((unsigned int)deco);
456 app.rememberDecostate((unsigned int)
457 FluxboxWindow::DECORM_TITLEBAR
458 | FluxboxWindow::DECORM_ICONIFY
459 | FluxboxWindow::DECORM_MENU
460 | FluxboxWindow::DECORM_TAB
461 );
462 } else if (strcasecmp(str_label.c_str(), "TOOL") == 0) {
463 app.rememberDecostate((unsigned int)
464 FluxboxWindow::DECORM_TITLEBAR
465 | FluxboxWindow::DECORM_MENU
466 );
467 } else if (strcasecmp(str_label.c_str(), "BORDER") == 0) {
468 app.rememberDecostate((unsigned int)
469 FluxboxWindow::DECORM_BORDER
470 | FluxboxWindow::DECORM_MENU
471 );
472 } else if (strcasecmp(str_label.c_str(), "TAB") == 0) {
473 app.rememberDecostate((unsigned int)
474 FluxboxWindow::DECORM_BORDER
475 | FluxboxWindow::DECORM_MENU
476 | FluxboxWindow::DECORM_TAB
477 );
478 } else {
479 unsigned int mask;
480 if (getuint(str_label.c_str(), mask))
481 app.rememberDecostate(mask);
482 else
483 had_error = 1;
484 }
485 } else if (strcasecmp(str_key.c_str(), "Alpha") == 0) { 482 } else if (strcasecmp(str_key.c_str(), "Alpha") == 0) {
486 int focused_a, unfocused_a; 483 int focused_a, unfocused_a;
487 if (sscanf(str_label.c_str(), "%i %i", &focused_a, &unfocused_a) == 2) 484 if (sscanf(str_label.c_str(), "%i %i", &focused_a, &unfocused_a) == 2)
diff --git a/src/Remember.hh b/src/Remember.hh
index 581e525..a1e75da 100644
--- a/src/Remember.hh
+++ b/src/Remember.hh
@@ -205,6 +205,8 @@ public:
205 Remember(); 205 Remember();
206 ~Remember(); 206 ~Remember();
207 207
208 static int getDecoFromString(const std::string &str);
209
208 Application* find(WinClient &winclient); 210 Application* find(WinClient &winclient);
209 Application* add(WinClient &winclient); 211 Application* add(WinClient &winclient);
210 FluxboxWindow* findGroup(Application *, BScreen &screen); 212 FluxboxWindow* findGroup(Application *, BScreen &screen);
diff --git a/src/Screen.cc b/src/Screen.cc
index 3dfe324..3f3daf9 100644
--- a/src/Screen.cc
+++ b/src/Screen.cc
@@ -293,7 +293,7 @@ BScreen::ScreenResource::ScreenResource(FbTk::ResourceManager &rm,
293 auto_raise(rm, true, scrname+".autoRaise", altscrname+".AutoRaise"), 293 auto_raise(rm, true, scrname+".autoRaise", altscrname+".AutoRaise"),
294 click_raises(rm, true, scrname+".clickRaises", altscrname+".ClickRaises"), 294 click_raises(rm, true, scrname+".clickRaises", altscrname+".ClickRaises"),
295 decorate_transient(rm, true, scrname+".decorateTransient", altscrname+".DecorateTransient"), 295 decorate_transient(rm, true, scrname+".decorateTransient", altscrname+".DecorateTransient"),
296 default_deco(rm, FluxboxWindow::DECORM_LAST-1, scrname+".defaultDeco", altscrname+".DefaultDeco"), 296 default_deco(rm, "NORMAL", scrname+".defaultDeco", altscrname+".DefaultDeco"),
297 rootcommand(rm, "", scrname+".rootCommand", altscrname+".RootCommand"), 297 rootcommand(rm, "", scrname+".rootCommand", altscrname+".RootCommand"),
298 resize_model(rm, BOTTOMRESIZE, scrname+".resizeMode", altscrname+".ResizeMode"), 298 resize_model(rm, BOTTOMRESIZE, scrname+".resizeMode", altscrname+".ResizeMode"),
299 tab_placement(rm, FbWinFrame::TOPLEFT, scrname+".tab.placement", altscrname+".Tab.Placement"), 299 tab_placement(rm, FbWinFrame::TOPLEFT, scrname+".tab.placement", altscrname+".Tab.Placement"),
diff --git a/src/Screen.hh b/src/Screen.hh
index 8694f6d..bf03ac6 100644
--- a/src/Screen.hh
+++ b/src/Screen.hh
@@ -123,7 +123,7 @@ public:
123 bool doFullMax() const { return *resource.full_max; } 123 bool doFullMax() const { return *resource.full_max; }
124 bool doShowWindowPos() const { return *resource.show_window_pos; } 124 bool doShowWindowPos() const { return *resource.show_window_pos; }
125 bool decorateTransient() const { return *resource.decorate_transient; } 125 bool decorateTransient() const { return *resource.decorate_transient; }
126 unsigned int defaultDeco() const { return *resource.default_deco; } 126 const std::string &defaultDeco() const { return *resource.default_deco; }
127 const std::string &windowMenuFilename() const { return *resource.windowmenufile; } 127 const std::string &windowMenuFilename() const { return *resource.windowmenufile; }
128 FbTk::ImageControl &imageControl() { return *m_image_control.get(); } 128 FbTk::ImageControl &imageControl() { return *m_image_control.get(); }
129 // menus 129 // menus
@@ -449,7 +449,7 @@ private:
449 workspace_warping, 449 workspace_warping,
450 desktop_wheeling, reverse_wheeling, show_window_pos, 450 desktop_wheeling, reverse_wheeling, show_window_pos,
451 auto_raise, click_raises, decorate_transient; 451 auto_raise, click_raises, decorate_transient;
452 FbTk::Resource<unsigned int> default_deco; 452 FbTk::Resource<std::string> default_deco;
453 FbTk::Resource<std::string> rootcommand; 453 FbTk::Resource<std::string> rootcommand;
454 FbTk::Resource<ResizeModel> resize_model; 454 FbTk::Resource<ResizeModel> resize_model;
455 FbTk::Resource<FbWinFrame::TabPlacement> tab_placement; 455 FbTk::Resource<FbWinFrame::TabPlacement> tab_placement;
diff --git a/src/Window.cc b/src/Window.cc
index 3d0db79..5b10058 100644
--- a/src/Window.cc
+++ b/src/Window.cc
@@ -394,10 +394,10 @@ void FluxboxWindow::init() {
394 m_blackbox_attrib.premax_w = m_blackbox_attrib.premax_h = 0; 394 m_blackbox_attrib.premax_w = m_blackbox_attrib.premax_h = 0;
395 395
396 // set default decorations but don't apply them 396 // set default decorations but don't apply them
397 setDecorationMask(screen().defaultDeco(), false); 397 setDecorationMask(Remember::getDecoFromString(screen().defaultDeco()), false);
398 398
399 functions.resize = functions.move = functions.iconify = functions.maximize = functions.close = functions.tabable = true; 399 functions.resize = functions.move = functions.iconify = functions.maximize
400 decorations.close = false; 400 = functions.close = functions.tabable = true;
401 401
402 if (m_client->getBlackboxHint() != 0) 402 if (m_client->getBlackboxHint() != 0)
403 updateBlackboxHintsFromClient(*m_client); 403 updateBlackboxHintsFromClient(*m_client);