all repos — fluxbox @ 6e9130b2ad2fcbca102d2baffff05a8c8d7b7d5a

custom fork of the fluxbox windowmanager

show root menu and workspace menu under mouse
fluxgen fluxgen
commit

6e9130b2ad2fcbca102d2baffff05a8c8d7b7d5a

parent

12532042f5d6f1245ba308d7db024c8970c57df8

2 files changed, 54 insertions(+), 5 deletions(-)

jump to
M src/FbCommands.ccsrc/FbCommands.cc

@@ -19,7 +19,7 @@ // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING

// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER // DEALINGS IN THE SOFTWARE. -// $Id: FbCommands.cc,v 1.15 2003/08/30 11:59:29 fluxgen Exp $ +// $Id: FbCommands.cc,v 1.16 2003/09/06 14:13:06 fluxgen Exp $ #include "FbCommands.hh" #include "fluxbox.hh"

@@ -52,7 +52,7 @@ if (Fluxbox::instance()->mouseScreen() == 0)

screen_num = 0; else screen_num = Fluxbox::instance()->mouseScreen()->screenNumber(); - } + } sprintf(intbuff, "%d", screen_num);

@@ -109,8 +109,52 @@ if (screen == 0)

return; if (screen->getRootmenu()) { - screen->getRootmenu()->show(); - screen->getRootmenu()->grabInputFocus(); + + Window root_ret; + Window window_ret; + + int rx, ry; + int wx, wy; + unsigned int mask; + + if ( XQueryPointer(FbTk::App::instance()->display(), + screen->rootWindow().window(), &root_ret, &window_ret, + &rx, &ry, &wx, &wy, &mask) ) { + + if ( rx - (screen->getRootmenu()->width()/2) > 0 ) + rx-= screen->getRootmenu()->width()/2; + screen->getRootmenu()->move(rx, ry); + } + + screen->getRootmenu()->show(); + screen->getRootmenu()->grabInputFocus(); + } +} + +void ShowWorkspaceMenuCmd::execute() { + BScreen *screen = Fluxbox::instance()->mouseScreen(); + if (screen == 0) + return; + + if (screen->getWorkspacemenu()) { + + Window root_ret; + Window window_ret; + + int rx, ry; + int wx, wy; + unsigned int mask; + + if ( XQueryPointer(FbTk::App::instance()->display(), + screen->rootWindow().window(), &root_ret, &window_ret, + &rx, &ry, &wx, &wy, &mask) ) { + + if ( rx - (screen->getWorkspacemenu()->width()/2) > 0 ) + rx-= screen->getWorkspacemenu()->width()/2; + screen->getWorkspacemenu()->move(rx, ry); + } + screen->getWorkspacemenu()->show(); + screen->getWorkspacemenu()->grabInputFocus(); } }
M src/FbCommands.hhsrc/FbCommands.hh

@@ -19,7 +19,7 @@ // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING

// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER // DEALINGS IN THE SOFTWARE. -// $Id: FbCommands.hh,v 1.10 2003/08/30 11:59:29 fluxgen Exp $ +// $Id: FbCommands.hh,v 1.11 2003/09/06 14:13:06 fluxgen Exp $ // \file contains basic commands to restart, reconfigure, execute command and exit fluxbox

@@ -79,6 +79,11 @@ std::string m_filename;

}; class ShowRootMenuCmd: public FbTk::Command { +public: + void execute(); +}; + +class ShowWorkspaceMenuCmd: public FbTk::Command { public: void execute(); };