From 9c3b06945a4079f1cbd83441a0a68fc6694b6be5 Mon Sep 17 00:00:00 2001 From: rathnor Date: Sat, 19 Jul 2003 13:51:24 +0000 Subject: fix most commands to run on screen mouse is in, rather than focused window --- ChangeLog | 3 +++ src/FbCommands.cc | 6 +++--- src/WorkspaceCmd.cc | 16 ++++++++-------- src/fluxbox.hh | 5 ++++- 4 files changed, 18 insertions(+), 12 deletions(-) diff --git a/ChangeLog b/ChangeLog index d2619be..352ce5e 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,6 +1,9 @@ (Format: Year/Month/Day) Changes for 0.9.5: *03/07/19: + * Make most Commands execute on mouse screen rather than screen + of focused window (Simon) + FbCommands.cc WorkspaceCmd.cc * Fix xinerama options (again) for Slit and Toolbar (Simon) Xinerama.hh Slit.hh/cc Toolbar.hh/cc * Move menu alpha setting into MenuTheme (Simon) diff --git a/src/FbCommands.cc b/src/FbCommands.cc index 1c84154..3529ebf 100644 --- a/src/FbCommands.cc +++ b/src/FbCommands.cc @@ -19,7 +19,7 @@ // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER // DEALINGS IN THE SOFTWARE. -// $Id: FbCommands.cc,v 1.11 2003/07/01 20:24:19 fluxgen Exp $ +// $Id: FbCommands.cc,v 1.12 2003/07/19 13:51:24 rathnor Exp $ #include "FbCommands.hh" #include "fluxbox.hh" @@ -47,10 +47,10 @@ void ExecuteCmd::execute() { char intbuff[64]; int screen_num = m_screen_num; if (screen_num < 0) { - if (Fluxbox::instance()->keyScreen() == 0) + if (Fluxbox::instance()->mouseScreen() == 0) screen_num = 0; else - screen_num = Fluxbox::instance()->keyScreen()->screenNumber(); + screen_num = Fluxbox::instance()->mouseScreen()->screenNumber(); } sprintf(intbuff, "%d", screen_num); diff --git a/src/WorkspaceCmd.cc b/src/WorkspaceCmd.cc index 45bf7a2..ac71112 100644 --- a/src/WorkspaceCmd.cc +++ b/src/WorkspaceCmd.cc @@ -20,7 +20,7 @@ // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER // DEALINGS IN THE SOFTWARE. -// $Id: WorkspaceCmd.cc,v 1.2 2003/07/01 09:47:41 fluxgen Exp $ +// $Id: WorkspaceCmd.cc,v 1.3 2003/07/19 13:51:24 rathnor Exp $ #include "WorkspaceCmd.hh" #include "Workspace.hh" @@ -74,25 +74,25 @@ void PrevWindowCmd::execute() { } void NextWorkspaceCmd::execute() { - BScreen *screen = Fluxbox::instance()->keyScreen(); + BScreen *screen = Fluxbox::instance()->mouseScreen(); if (screen != 0) screen->nextWorkspace(); } void PrevWorkspaceCmd::execute() { - BScreen *screen = Fluxbox::instance()->keyScreen(); + BScreen *screen = Fluxbox::instance()->mouseScreen(); if (screen != 0) screen->prevWorkspace(); } void LeftWorkspaceCmd::execute() { - BScreen *screen = Fluxbox::instance()->keyScreen(); + BScreen *screen = Fluxbox::instance()->mouseScreen(); if (screen != 0) screen->leftWorkspace(m_param); } void RightWorkspaceCmd::execute() { - BScreen *screen = Fluxbox::instance()->keyScreen(); + BScreen *screen = Fluxbox::instance()->mouseScreen(); if (screen != 0) screen->rightWorkspace(m_param); } @@ -100,14 +100,14 @@ void RightWorkspaceCmd::execute() { JumpToWorkspaceCmd::JumpToWorkspaceCmd(int workspace_num):m_workspace_num(workspace_num) { } void JumpToWorkspaceCmd::execute() { - BScreen *screen = Fluxbox::instance()->keyScreen(); + BScreen *screen = Fluxbox::instance()->mouseScreen(); if (screen != 0 && m_workspace_num >= 0 && m_workspace_num < screen->getNumberOfWorkspaces()) screen->changeWorkspaceID(m_workspace_num); } void ArrangeWindowsCmd::execute() { - BScreen *screen = Fluxbox::instance()->keyScreen(); + BScreen *screen = Fluxbox::instance()->mouseScreen(); if (screen == 0) return; @@ -159,7 +159,7 @@ void ArrangeWindowsCmd::execute() { } void ShowDesktopCmd::execute() { - BScreen *screen = Fluxbox::instance()->keyScreen(); + BScreen *screen = Fluxbox::instance()->mouseScreen(); if (screen == 0) return; diff --git a/src/fluxbox.hh b/src/fluxbox.hh index d4c109c..1975929 100644 --- a/src/fluxbox.hh +++ b/src/fluxbox.hh @@ -22,7 +22,7 @@ // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER // DEALINGS IN THE SOFTWARE. -// $Id: fluxbox.hh,v 1.66 2003/07/19 11:55:49 rathnor Exp $ +// $Id: fluxbox.hh,v 1.67 2003/07/19 13:51:24 rathnor Exp $ #ifndef FLUXBOX_HH #define FLUXBOX_HH @@ -191,8 +191,11 @@ public: bool haveShape() const { return m_have_shape; } int shapeEventbase() const { return m_shape_eventbase; } void getDefaultDataFilename(char *, std::string &); + // screen mouse was in at last key event BScreen *mouseScreen() { return m_mousescreen; } + // screen of window that last key event (i.e. focused window) went to BScreen *keyScreen() { return m_keyscreen; } + // screen we are watching for modifier changes BScreen *watchingScreen() { return m_watching_screen; } const XEvent &lastEvent() const { return m_last_event; } private: -- cgit v0.11.2