summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/Windowmenu.cc41
1 files changed, 22 insertions, 19 deletions
diff --git a/src/Windowmenu.cc b/src/Windowmenu.cc
index d4bd8fb..87e08c7 100644
--- a/src/Windowmenu.cc
+++ b/src/Windowmenu.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: Windowmenu.cc,v 1.15 2002/07/23 13:49:01 fluxgen Exp $ 24// $Id: Windowmenu.cc,v 1.16 2002/08/12 03:27:31 fluxgen Exp $
25 25
26//use GNU extensions 26//use GNU extensions
27#ifndef _GNU_SOURCE 27#ifndef _GNU_SOURCE
@@ -132,57 +132,60 @@ void Windowmenu::show(void) {
132 132
133void Windowmenu::itemSelected(int button, unsigned int index) { 133void Windowmenu::itemSelected(int button, unsigned int index) {
134 BasemenuItem *item = find(index); 134 BasemenuItem *item = find(index);
135 135 hide();
136 switch (item->function()) { 136 switch (item->function()) {
137 case BScreen::WINDOWSHADE: 137 case BScreen::WINDOWSHADE:
138 hide(); 138 if (window->isIconic())
139 139 break;
140
140 window->shade(); 141 window->shade();
141 if (window->hasTab()) 142 if (window->hasTab())
142 window->getTab()->shade(); 143 window->getTab()->shade();
143 break; 144 break;
144 145
145 case BScreen::WINDOWICONIFY: 146 case BScreen::WINDOWICONIFY:
146 hide(); 147 if (!window->isIconic())
147 window->iconify(); 148 window->iconify();
148 break; 149 else
150 window->deiconify(); // restore window
151
152 break;
149 153
150 case BScreen::WINDOWMAXIMIZE: 154 case BScreen::WINDOWMAXIMIZE:
151 hide();
152 window->maximize((unsigned int) button); 155 window->maximize((unsigned int) button);
153 break; 156 break;
154 157
155 case BScreen::WINDOWCLOSE: 158 case BScreen::WINDOWCLOSE:
156 hide();
157 window->close(); 159 window->close();
158 break; 160 break;
159 161
160 case BScreen::WINDOWRAISE: 162 case BScreen::WINDOWRAISE:
161 hide(); 163 if (window->isIconic())
164 break;
165
162 if (window->hasTab()) 166 if (window->hasTab())
163 window->getTab()->raise(); //raise tabs 167 window->getTab()->raise(); //raise tabs
164 screen->getWorkspace(window->getWorkspaceNumber())->raiseWindow(window); 168 screen->getWorkspace(window->getWorkspaceNumber())->raiseWindow(window);
165 break; 169 break;
166 170
167 case BScreen::WINDOWLOWER: 171 case BScreen::WINDOWLOWER:
168 hide(); 172 if (window->isIconic())
169 screen->getWorkspace(window->getWorkspaceNumber())->lowerWindow(window); 173 break;
174
175 screen->getWorkspace(window->getWorkspaceNumber())->lowerWindow(window);
170 if (window->hasTab()) 176 if (window->hasTab())
171 window->getTab()->lower(); //lower tabs AND all it's windows 177 window->getTab()->lower(); //lower tabs AND all it's windows
172 break; 178 break;
173 179
174 case BScreen::WINDOWSTICK: 180 case BScreen::WINDOWSTICK:
175 hide();
176 window->stick(); 181 window->stick();
177 break; 182 break;
178 183
179 case BScreen::WINDOWKILL: 184 case BScreen::WINDOWKILL:
180 hide();
181 XKillClient(screen->getBaseDisplay()->getXDisplay(), 185 XKillClient(screen->getBaseDisplay()->getXDisplay(),
182 window->getClientWindow()); 186 window->getClientWindow());
183 break; 187 break;
184 case BScreen::WINDOWTAB: 188 case BScreen::WINDOWTAB:
185 hide();
186 window->setTab(!window->hasTab()); 189 window->setTab(!window->hasTab());
187 break; 190 break;
188 } 191 }