summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorfluxgen <fluxgen>2003-06-11 14:53:54 (GMT)
committerfluxgen <fluxgen>2003-06-11 14:53:54 (GMT)
commitee90d85b14dc2cfd49a28ed76a2586db69131f0d (patch)
treefacea0bcfac19a5f932b33e4ad0f44a81ae98012
parent32cdc02556ac89a4ec75e24d481c179c909114c0 (diff)
downloadfluxbox_lack-ee90d85b14dc2cfd49a28ed76a2586db69131f0d.zip
fluxbox_lack-ee90d85b14dc2cfd49a28ed76a2586db69131f0d.tar.bz2
hide toolbar menu and slit menu if we click on root window
-rw-r--r--src/fluxbox.cc19
1 files changed, 14 insertions, 5 deletions
diff --git a/src/fluxbox.cc b/src/fluxbox.cc
index b2154c7..7b87980 100644
--- a/src/fluxbox.cc
+++ b/src/fluxbox.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: fluxbox.cc,v 1.155 2003/06/11 10:50:59 rathnor Exp $ 25// $Id: fluxbox.cc,v 1.156 2003/06/11 14:53:54 fluxgen Exp $
26 26
27#include "fluxbox.hh" 27#include "fluxbox.hh"
28 28
@@ -436,8 +436,7 @@ Fluxbox::Fluxbox(int argc, char **argv, const char *dpy_name, const char *rcfile
436 XSetErrorHandler((XErrorHandler) handleXErrors); 436 XSetErrorHandler((XErrorHandler) handleXErrors);
437 437
438 //catch system signals 438 //catch system signals
439 SignalHandler &sigh = SignalHandler::instance(); 439 SignalHandler &sigh = SignalHandler::instance();
440
441 sigh.registerHandler(SIGSEGV, this); 440 sigh.registerHandler(SIGSEGV, this);
442 sigh.registerHandler(SIGFPE, this); 441 sigh.registerHandler(SIGFPE, this);
443 sigh.registerHandler(SIGTERM, this); 442 sigh.registerHandler(SIGTERM, this);
@@ -512,7 +511,8 @@ Fluxbox::Fluxbox(int argc, char **argv, const char *dpy_name, const char *rcfile
512 continue; 511 continue;
513 } 512 }
514#ifdef HAVE_RANDR 513#ifdef HAVE_RANDR
515 514 // setup RANDR for this screens root window
515 // we need to determine if we should use old randr select input function or not
516#ifdef X_RRScreenChangeSelectInput 516#ifdef X_RRScreenChangeSelectInput
517 // use old set randr event 517 // use old set randr event
518 XRRScreenChangeSelectInput(disp, screen->rootWindow().window(), True); 518 XRRScreenChangeSelectInput(disp, screen->rootWindow().window(), True);
@@ -894,6 +894,7 @@ void Fluxbox::handleEvent(XEvent * const e) {
894} 894}
895 895
896void Fluxbox::handleButtonEvent(XButtonEvent &be) { 896void Fluxbox::handleButtonEvent(XButtonEvent &be) {
897
897 switch (be.type) { 898 switch (be.type) {
898 case ButtonPress: { 899 case ButtonPress: {
899 m_last_time = be.time; 900 m_last_time = be.time;
@@ -901,6 +902,14 @@ void Fluxbox::handleButtonEvent(XButtonEvent &be) {
901 BScreen *screen = searchScreen(be.window); 902 BScreen *screen = searchScreen(be.window);
902 if (screen == 0) 903 if (screen == 0)
903 break; // end case 904 break; // end case
905#ifdef SLIT
906 // hide slit menu
907 if (screen->slit())
908 screen->slit()->menu().hide();
909#endif // SLIT
910 // hide toolbar menu
911 if (screen->toolbar())
912 screen->toolbar()->menu().hide();
904 913
905 if (be.button == 1) { 914 if (be.button == 1) {
906 if (! screen->isRootColormapInstalled()) 915 if (! screen->isRootColormapInstalled())
@@ -910,7 +919,7 @@ void Fluxbox::handleButtonEvent(XButtonEvent &be) {
910 screen->getWorkspacemenu()->hide(); 919 screen->getWorkspacemenu()->hide();
911 if (screen->getRootmenu()->isVisible()) 920 if (screen->getRootmenu()->isVisible())
912 screen->getRootmenu()->hide(); 921 screen->getRootmenu()->hide();
913 922
914 } else if (be.button == 2) { 923 } else if (be.button == 2) {
915 int mx = be.x_root - 924 int mx = be.x_root -
916 (screen->getWorkspacemenu()->width() / 2); 925 (screen->getWorkspacemenu()->width() / 2);