summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorfluxgen <fluxgen>2002-08-12 03:28:17 (GMT)
committerfluxgen <fluxgen>2002-08-12 03:28:17 (GMT)
commit88bb66a1eebba460aedbc6dcd486f725fd3ca9a0 (patch)
treec5c1bf8e8bc5311c2f8e6b6c3b5f1637a666f7a7
parenta691d915f85a7010ad9d6c4be3ac6ab34cc202d6 (diff)
downloadfluxbox_lack-88bb66a1eebba460aedbc6dcd486f725fd3ca9a0.zip
fluxbox_lack-88bb66a1eebba460aedbc6dcd486f725fd3ca9a0.tar.bz2
added showMenu function
-rw-r--r--src/Window.cc35
-rw-r--r--src/Window.hh4
2 files changed, 23 insertions, 16 deletions
diff --git a/src/Window.cc b/src/Window.cc
index 3c229a9..9ec789b 100644
--- a/src/Window.cc
+++ b/src/Window.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: Window.cc,v 1.66 2002/08/11 22:44:29 fluxgen Exp $ 25// $Id: Window.cc,v 1.67 2002/08/12 03:28:17 fluxgen Exp $
26 26
27#include "Window.hh" 27#include "Window.hh"
28 28
@@ -321,9 +321,9 @@ tab(0)
321 321
322 setFocusFlag(false); 322 setFocusFlag(false);
323 323
324 #ifdef GNOME 324#ifdef GNOME
325 updateGnomeAtoms(); 325 updateGnomeAtoms();
326 #endif 326#endif // GNOME
327 327
328#ifdef DEBUG 328#ifdef DEBUG
329 fprintf(stderr, "%s(%d): FluxboxWindow(this=%p)\n", __FILE__, __LINE__, this); 329 fprintf(stderr, "%s(%d): FluxboxWindow(this=%p)\n", __FILE__, __LINE__, this);
@@ -333,7 +333,7 @@ tab(0)
333 333
334 334
335FluxboxWindow::~FluxboxWindow() { 335FluxboxWindow::~FluxboxWindow() {
336 if (screen==0) //the window wasn't created 336 if (screen == 0) //the window wasn't created
337 return; 337 return;
338 338
339 Fluxbox *fluxbox = Fluxbox::instance(); 339 Fluxbox *fluxbox = Fluxbox::instance();
@@ -360,12 +360,12 @@ FluxboxWindow::~FluxboxWindow() {
360 tab = 0; 360 tab = 0;
361 } 361 }
362 362
363 if (client.mwm_hint!=0) { 363 if (client.mwm_hint != 0) {
364 XFree(client.mwm_hint); 364 XFree(client.mwm_hint);
365 client.mwm_hint = 0; 365 client.mwm_hint = 0;
366 } 366 }
367 367
368 if (client.blackbox_hint!=0) { 368 if (client.blackbox_hint != 0) {
369 XFree(client.blackbox_hint); 369 XFree(client.blackbox_hint);
370 client.blackbox_hint = 0; 370 client.blackbox_hint = 0;
371 } 371 }
@@ -374,9 +374,9 @@ FluxboxWindow::~FluxboxWindow() {
374 if (isTransient()) { 374 if (isTransient()) {
375 //guard from having transient_for = this 375 //guard from having transient_for = this
376 if (client.transient_for == this) { 376 if (client.transient_for == this) {
377 #ifdef DEBUG 377#ifdef DEBUG
378 cerr<<__FILE__<<"("<<__LINE__<<"): WARNING! client.transient_for == this WARNING!"<<endl; 378 cerr<<__FILE__<<"("<<__LINE__<<"): WARNING! client.transient_for == this WARNING!"<<endl;
379 #endif //DEBUG 379#endif //DEBUG
380 client.transient_for = 0; 380 client.transient_for = 0;
381 } 381 }
382 382
@@ -1954,6 +1954,10 @@ void FluxboxWindow::withdraw() {
1954 1954
1955 1955
1956void FluxboxWindow::maximize(unsigned int button) { 1956void FluxboxWindow::maximize(unsigned int button) {
1957 // deiconify if we're iconic
1958 if (isIconic())
1959 deiconify();
1960
1957 if (! maximized) { 1961 if (! maximized) {
1958 int dx, dy; 1962 int dx, dy;
1959 unsigned int dw, dh, slitModL = 0, slitModR = 0, slitModT = 0, slitModB = 0; 1963 unsigned int dw, dh, slitModL = 0, slitModR = 0, slitModT = 0, slitModB = 0;
@@ -2619,7 +2623,14 @@ void FluxboxWindow::restoreAttributes() {
2619 setState(current_state); 2623 setState(current_state);
2620} 2624}
2621 2625
2622 2626void FluxboxWindow::showMenu(int mx, int my) {
2627 windowmenu->move(mx, my);
2628 windowmenu->show();
2629 XRaiseWindow(display, windowmenu->windowID());
2630 XRaiseWindow(display, windowmenu->getSendToMenu()->windowID());
2631 XRaiseWindow(display, windowmenu->getSendGroupToMenu()->windowID());
2632}
2633
2623void FluxboxWindow::restoreGravity() { 2634void FluxboxWindow::restoreGravity() {
2624 // restore x coordinate 2635 // restore x coordinate
2625 switch (client.win_gravity) { 2636 switch (client.win_gravity) {
@@ -3173,11 +3184,7 @@ void FluxboxWindow::buttonPressEvent(XButtonEvent *be) {
3173 3184
3174 if (windowmenu) { 3185 if (windowmenu) {
3175 if (! windowmenu->isVisible()) { // if not window menu is visible then show it 3186 if (! windowmenu->isVisible()) { // if not window menu is visible then show it
3176 windowmenu->move(mx, my); 3187 showMenu(mx, my);
3177 windowmenu->show();
3178 XRaiseWindow(display, windowmenu->windowID());
3179 XRaiseWindow(display, windowmenu->getSendToMenu()->windowID());
3180 XRaiseWindow(display, windowmenu->getSendGroupToMenu()->windowID());
3181 } else //else hide menu 3188 } else //else hide menu
3182 windowmenu->hide(); 3189 windowmenu->hide();
3183 } 3190 }
diff --git a/src/Window.hh b/src/Window.hh
index 549971e..33a348f 100644
--- a/src/Window.hh
+++ b/src/Window.hh
@@ -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: Window.hh,v 1.26 2002/08/11 22:33:41 fluxgen Exp $ 25// $Id: Window.hh,v 1.27 2002/08/12 03:28:17 fluxgen Exp $
26 26
27#ifndef WINDOW_HH 27#ifndef WINDOW_HH
28#define WINDOW_HH 28#define WINDOW_HH
@@ -201,7 +201,7 @@ public:
201 void setWorkspace(int n); 201 void setWorkspace(int n);
202 void changeBlackboxHints(BaseDisplay::BlackboxHints *bh); 202 void changeBlackboxHints(BaseDisplay::BlackboxHints *bh);
203 void restoreAttributes(); 203 void restoreAttributes();
204 204 void showMenu(int mx, int my);
205 205
206 void buttonPressEvent(XButtonEvent *be); 206 void buttonPressEvent(XButtonEvent *be);
207 void buttonReleaseEvent(XButtonEvent *be); 207 void buttonReleaseEvent(XButtonEvent *be);