summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorfluxgen <fluxgen>2003-02-16 16:45:23 (GMT)
committerfluxgen <fluxgen>2003-02-16 16:45:23 (GMT)
commit9a82a5b1dc3cacafbdda7b54fb9ebf71ef526be3 (patch)
tree64cf96a5e873b2663bd5f4ed28dc35f9dd0f09a0 /src
parentc0e839b64d00f5f4806e9c8092e3f41a63bd98c4 (diff)
downloadfluxbox_lack-9a82a5b1dc3cacafbdda7b54fb9ebf71ef526be3.zip
fluxbox_lack-9a82a5b1dc3cacafbdda7b54fb9ebf71ef526be3.tar.bz2
raise and focus when we click on titlebar and fixed workspace names in workspace menu
Diffstat (limited to 'src')
-rw-r--r--src/Screen.cc44
1 files changed, 25 insertions, 19 deletions
diff --git a/src/Screen.cc b/src/Screen.cc
index ccff0d0..4650fad 100644
--- a/src/Screen.cc
+++ b/src/Screen.cc
@@ -22,7 +22,7 @@
22// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER 22// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
23// DEALINGS IN THE SOFTWARE. 23// DEALINGS IN THE SOFTWARE.
24 24
25// $Id: Screen.cc,v 1.107 2003/02/16 15:12:08 rathnor Exp $ 25// $Id: Screen.cc,v 1.108 2003/02/16 16:45:23 fluxgen Exp $
26 26
27 27
28#include "Screen.hh" 28#include "Screen.hh"
@@ -287,6 +287,13 @@ void setupWorkspacemenu(BScreen &scr, FbTk::Menu &menu) {
287 RefCount<Command> remove_last(new RemoveLastWorkspaceCmd(scr)); 287 RefCount<Command> remove_last(new RemoveLastWorkspaceCmd(scr));
288 menu.insert("New Workspace", new_workspace); 288 menu.insert("New Workspace", new_workspace);
289 menu.insert("Remove Last", remove_last); 289 menu.insert("Remove Last", remove_last);
290 // for each workspace add workspace name and it's menu to our workspace menu
291 for (size_t workspace = 0; workspace < scr.getCount(); ++workspace) {
292 Workspace *wkspc = scr.getWorkspace(workspace);
293 menu.insert(wkspc->name().c_str(), &wkspc->menu());
294 }
295
296 // update graphics
290 menu.update(); 297 menu.update();
291} 298}
292 299
@@ -484,14 +491,14 @@ BScreen::BScreen(ResourceManager &rm,
484 Workspace *wkspc = (Workspace *) 0; 491 Workspace *wkspc = (Workspace *) 0;
485 if (*resource.workspaces != 0) { 492 if (*resource.workspaces != 0) {
486 for (int i = 0; i < *resource.workspaces; ++i) { 493 for (int i = 0; i < *resource.workspaces; ++i) {
487 wkspc = new Workspace(this, m_layermanager, workspacesList.size()); 494 wkspc = new Workspace(*this, m_layermanager, workspacesList.size());
488 workspacesList.push_back(wkspc); 495 workspacesList.push_back(wkspc);
489 workspacemenu->insert(wkspc->name().c_str(), &wkspc->menu()); 496 // workspacemenu->insert(wkspc->name().c_str(), &wkspc->menu());
490 } 497 }
491 } else { 498 } else {
492 wkspc = new Workspace(this, m_layermanager, workspacesList.size()); 499 wkspc = new Workspace(*this, m_layermanager, workspacesList.size());
493 workspacesList.push_back(wkspc); 500 workspacesList.push_back(wkspc);
494 workspacemenu->insert(wkspc->name().c_str(), &wkspc->menu()); 501 // workspacemenu->insert(wkspc->name().c_str(), &wkspc->menu());
495 } 502 }
496 503
497 current_workspace = workspacesList.front(); 504 current_workspace = workspacesList.front();
@@ -703,13 +710,10 @@ void BScreen::reconfigure() {
703 workspacemenu->reconfigure(); 710 workspacemenu->reconfigure();
704 m_configmenu->reconfigure(); 711 m_configmenu->reconfigure();
705 712
706 { 713 initMenu();
707 //int remember_sub = m_rootmenu->currentSubmenu(); 714 raiseWindows(Workspace::Stack());
708 initMenu(); 715 m_rootmenu->reconfigure();
709 raiseWindows(Workspace::Stack()); 716
710 m_rootmenu->reconfigure();
711 //m_rootmenu->drawSubmenu(remember_sub);
712 }
713 717
714 // m_toolbar->setPlacement(*resource.toolbar_placement); 718 // m_toolbar->setPlacement(*resource.toolbar_placement);
715 m_toolbar->reconfigure(); 719 m_toolbar->reconfigure();
@@ -816,7 +820,7 @@ void BScreen::setAntialias(bool value) {
816} 820}
817 821
818int BScreen::addWorkspace() { 822int BScreen::addWorkspace() {
819 Workspace *wkspc = new Workspace(this, m_layermanager, workspacesList.size()); 823 Workspace *wkspc = new Workspace(*this, m_layermanager, workspacesList.size());
820 workspacesList.push_back(wkspc); 824 workspacesList.push_back(wkspc);
821 addWorkspaceName(wkspc->name().c_str()); // update names 825 addWorkspaceName(wkspc->name().c_str()); // update names
822 //add workspace to workspacemenu 826 //add workspace to workspacemenu
@@ -954,8 +958,8 @@ void BScreen::sendToWorkspace(unsigned int id, FluxboxWindow *win, bool changeWS
954 win->setInputFocus(); 958 win->setInputFocus();
955 } 959 }
956#ifdef DEBUG 960#ifdef DEBUG
957 cerr<<"Sending to id = "<<id<<endl; 961 cerr<<__FILE__<<": Sending to id = "<<id<<endl;
958 cerr<<"win->workspaceId="<<win->getWorkspaceNumber()<<endl; 962 cerr<<__FILE__<<": win->workspaceId="<<win->getWorkspaceNumber()<<endl;
959#endif //DEBUG 963#endif //DEBUG
960 964
961 } 965 }
@@ -1123,7 +1127,8 @@ void BScreen::setupWindowActions(FluxboxWindow &win) {
1123 CommandRef close_cmd(new WindowCmd(win, &FluxboxWindow::close)); 1127 CommandRef close_cmd(new WindowCmd(win, &FluxboxWindow::close));
1124 CommandRef shade_cmd(new WindowCmd(win, &FluxboxWindow::shade)); 1128 CommandRef shade_cmd(new WindowCmd(win, &FluxboxWindow::shade));
1125 CommandRef raise_cmd(new WindowCmd(win, &FluxboxWindow::raise)); 1129 CommandRef raise_cmd(new WindowCmd(win, &FluxboxWindow::raise));
1126 CommandRef lower_cmd(new WindowCmd(win, &FluxboxWindow::lower)); 1130 CommandRef raise_and_focus_cmd(new WindowCmd(win, &FluxboxWindow::raiseAndFocus));
1131 CommandRef lower_cmd(new WindowCmd(win, &FluxboxWindow::raise));
1127 CommandRef stick_cmd(new WindowCmd(win, &FluxboxWindow::stick)); 1132 CommandRef stick_cmd(new WindowCmd(win, &FluxboxWindow::stick));
1128 CommandRef show_menu_cmd(new WindowCmd(win, &FluxboxWindow::popupMenu)); 1133 CommandRef show_menu_cmd(new WindowCmd(win, &FluxboxWindow::popupMenu));
1129 1134
@@ -1133,7 +1138,8 @@ void BScreen::setupWindowActions(FluxboxWindow &win) {
1133 // get titlebar configuration 1138 // get titlebar configuration
1134 const vector<Fluxbox::Titlebar> *dir = &Fluxbox::instance()->getTitlebarLeft(); 1139 const vector<Fluxbox::Titlebar> *dir = &Fluxbox::instance()->getTitlebarLeft();
1135 for (char c=0; c<2; c++) { 1140 for (char c=0; c<2; c++) {
1136 for (unsigned int i=0; i< dir->size(); ++i) { 1141
1142 for (size_t i=0; i< dir->size(); ++i) {
1137 //create new buttons 1143 //create new buttons
1138 FbTk::Button *newbutton = 0; 1144 FbTk::Button *newbutton = 0;
1139 if (win.isIconifiable() && (*dir)[i] == Fluxbox::MINIMIZE) { 1145 if (win.isIconifiable() && (*dir)[i] == Fluxbox::MINIMIZE) {
@@ -1155,7 +1161,7 @@ void BScreen::setupWindowActions(FluxboxWindow &win) {
1155 newbutton->setOnClick(maximize_vert_cmd, 2); 1161 newbutton->setOnClick(maximize_vert_cmd, 2);
1156 1162
1157#ifdef DEBUG 1163#ifdef DEBUG
1158 cerr<<__FILE__<<":Creating maximize button"<<endl; 1164 cerr<<__FILE__<<": Creating maximize button"<<endl;
1159#endif // DEBUG 1165#endif // DEBUG
1160 } else if (win.isClosable() && (*dir)[i] == Fluxbox::CLOSE) { 1166 } else if (win.isClosable() && (*dir)[i] == Fluxbox::CLOSE) {
1161 newbutton = new WinButton(WinButton::CLOSE, 1167 newbutton = new WinButton(WinButton::CLOSE,
@@ -1188,7 +1194,7 @@ void BScreen::setupWindowActions(FluxboxWindow &win) {
1188 } // end for c 1194 } // end for c
1189 1195
1190 // setup titlebar 1196 // setup titlebar
1191 frame.setOnClickTitlebar(raise_cmd, 1, false, true); // on press with button 1 1197 frame.setOnClickTitlebar(raise_and_focus_cmd, 1, false, true); // on press with button 1
1192 frame.setOnClickTitlebar(shade_cmd, 1, true); // doubleclick with button 1 1198 frame.setOnClickTitlebar(shade_cmd, 1, true); // doubleclick with button 1
1193 frame.setOnClickTitlebar(show_menu_cmd, 3); // on release with button 3 1199 frame.setOnClickTitlebar(show_menu_cmd, 3); // on release with button 3
1194 frame.setOnClickTitlebar(lower_cmd, 2, false, true); // on press with button 2 1200 frame.setOnClickTitlebar(lower_cmd, 2, false, true); // on press with button 2