From: Dana Jansens Date: Tue, 16 Jul 2002 05:00:09 +0000 (+0000) Subject: Click Mouse Placement is BACK!#!# X-Git-Url: https://git.brokenzipper.com/gitweb?a=commitdiff_plain;h=daaac0dfe24d92bea54cd5ddee46861a1fe733bd;p=chaz%2Fopenbox Click Mouse Placement is BACK!#!# --- diff --git a/src/Configmenu.cc b/src/Configmenu.cc index c4f2326e..e060f8de 100644 --- a/src/Configmenu.cc +++ b/src/Configmenu.cc @@ -221,6 +221,8 @@ Configmenu::Placementmenu::Placementmenu(Configmenu *cm): BScreen::CascadePlacement); insert(i18n(ConfigmenuSet, ConfigmenuUnderMouse, "Under Mouse Placement"), BScreen::UnderMousePlacement); + insert(i18n(ConfigmenuSet, ConfigmenuClickMouse, "Click Mouse Placement"), + BScreen::ClickMousePlacement); insert(i18n(ConfigmenuSet, ConfigmenuLeftRight, "Left to Right"), BScreen::LeftRight); insert(i18n(ConfigmenuSet, ConfigmenuRightLeft, "Right to Left"), @@ -246,23 +248,24 @@ void Configmenu::Placementmenu::setValues(void) { setItemSelected(1, placement == BScreen::ColSmartPlacement); setItemSelected(2, placement == BScreen::CascadePlacement); setItemSelected(3, placement == BScreen::UnderMousePlacement); + setItemSelected(4, placement == BScreen::ClickMousePlacement); bool rl = (getScreen()->getRowPlacementDirection() == BScreen::LeftRight), tb = (getScreen()->getColPlacementDirection() == BScreen::TopBottom), e = placement != BScreen::UnderMousePlacement; - setItemSelected(4, rl); - setItemSelected(5, ! rl); - setItemEnabled(4, e); + setItemSelected(5, rl); + setItemSelected(6, ! rl); setItemEnabled(5, e); - - setItemSelected(6, tb); - setItemSelected(7, ! tb); setItemEnabled(6, e); + + setItemSelected(7, tb); + setItemSelected(8, ! tb); setItemEnabled(7, e); + setItemEnabled(8, e); - setItemSelected(8, getScreen()->getPlaceIgnoreShaded()); - setItemSelected(9, getScreen()->getPlaceIgnoreMaximized()); + setItemSelected(9, getScreen()->getPlaceIgnoreShaded()); + setItemSelected(10, getScreen()->getPlaceIgnoreMaximized()); } @@ -289,10 +292,11 @@ void Configmenu::Placementmenu::itemSelected(int button, unsigned int index) { setItemSelected(1, false); setItemSelected(2, false); setItemSelected(3, false); - setItemEnabled(4, true); + setItemSelected(4, false); setItemEnabled(5, true); setItemEnabled(6, true); setItemEnabled(7, true); + setItemEnabled(8, true); break; @@ -303,10 +307,11 @@ void Configmenu::Placementmenu::itemSelected(int button, unsigned int index) { setItemSelected(1, true); setItemSelected(2, false); setItemSelected(3, false); - setItemEnabled(4, true); + setItemSelected(4, false); setItemEnabled(5, true); setItemEnabled(6, true); setItemEnabled(7, true); + setItemEnabled(8, true); break; @@ -317,10 +322,11 @@ void Configmenu::Placementmenu::itemSelected(int button, unsigned int index) { setItemSelected(1, false); setItemSelected(2, true); setItemSelected(3, false); - setItemEnabled(4, true); + setItemSelected(4, false); setItemEnabled(5, true); setItemEnabled(6, true); setItemEnabled(7, true); + setItemEnabled(8, true); break; @@ -331,49 +337,65 @@ void Configmenu::Placementmenu::itemSelected(int button, unsigned int index) { setItemSelected(1, false); setItemSelected(2, false); setItemSelected(3, true); - setItemEnabled(4, false); + setItemSelected(4, false); setItemEnabled(5, false); setItemEnabled(6, false); setItemEnabled(7, false); + setItemEnabled(8, false); + + break; + + case BScreen::ClickMousePlacement: + getScreen()->savePlacementPolicy(item->function()); + + setItemSelected(0, false); + setItemSelected(1, false); + setItemSelected(2, false); + setItemSelected(3, false); + setItemSelected(4, true); + setItemEnabled(5, false); + setItemEnabled(6, false); + setItemEnabled(7, false); + setItemEnabled(8, false); break; case BScreen::LeftRight: getScreen()->saveRowPlacementDirection(BScreen::LeftRight); - setItemSelected(4, true); - setItemSelected(5, false); + setItemSelected(5, true); + setItemSelected(6, false); break; case BScreen::RightLeft: getScreen()->saveRowPlacementDirection(BScreen::RightLeft); - setItemSelected(4, false); - setItemSelected(5, true); + setItemSelected(5, false); + setItemSelected(6, true); break; case BScreen::TopBottom: getScreen()->saveColPlacementDirection(BScreen::TopBottom); - setItemSelected(6, true); - setItemSelected(7, false); + setItemSelected(7, true); + setItemSelected(8, false); break; case BScreen::BottomTop: getScreen()->saveColPlacementDirection(BScreen::BottomTop); - setItemSelected(6, false); - setItemSelected(7, true); + setItemSelected(7, false); + setItemSelected(8, true); break; case BScreen::IgnoreShaded: getScreen()->savePlaceIgnoreShaded(! getScreen()->getPlaceIgnoreShaded()); - setItemSelected(8, getScreen()->getPlaceIgnoreShaded()); + setItemSelected(9, getScreen()->getPlaceIgnoreShaded()); break; @@ -381,7 +403,7 @@ void Configmenu::Placementmenu::itemSelected(int button, unsigned int index) { getScreen()-> savePlaceIgnoreMaximized(! getScreen()->getPlaceIgnoreMaximized()); - setItemSelected(9, getScreen()->getPlaceIgnoreMaximized()); + setItemSelected(10, getScreen()->getPlaceIgnoreMaximized()); break; } diff --git a/src/Screen.cc b/src/Screen.cc index f4c3dcad..4df5ea17 100644 --- a/src/Screen.cc +++ b/src/Screen.cc @@ -444,6 +444,8 @@ void BScreen::savePlacementPolicy(int p) { const char *placement; switch (resource.placement_policy) { case CascadePlacement: placement = "CascadePlacement"; break; + case UnderMousePlacement: placement = "UnderMousePlacement"; break; + case ClickMousePlacement: placement = "ClickMousePlacement"; break; case ColSmartPlacement: placement = "ColSmartPlacement"; break; case RowSmartPlacement: default: placement = "RowSmartPlacement"; break; } @@ -647,6 +649,10 @@ void BScreen::load_rc(void) { if (config->getValue(screenstr + "windowPlacement", s)) { if (s == "CascadePlacement") resource.placement_policy = CascadePlacement; + else if (s == "UnderMousePlacement") + resource.placement_policy = UnderMousePlacement; + else if (s == "ClickMousePlacement") + resource.placement_policy = UnderMousePlacement; else if (s == "ColSmartPlacement") resource.placement_policy = ColSmartPlacement; else //if (s == "RowSmartPlacement") diff --git a/src/Screen.hh b/src/Screen.hh index 7701a1d2..8f7a26e9 100644 --- a/src/Screen.hh +++ b/src/Screen.hh @@ -190,8 +190,8 @@ private: void updateWorkArea(void); public: enum { RowSmartPlacement = 1, ColSmartPlacement, CascadePlacement, - UnderMousePlacement, LeftRight, RightLeft, TopBottom, BottomTop, - IgnoreShaded, IgnoreMaximized }; + UnderMousePlacement, ClickMousePlacement, LeftRight, RightLeft, + TopBottom, BottomTop, IgnoreShaded, IgnoreMaximized }; enum { RoundBullet = 1, TriangleBullet, SquareBullet, NoBullet }; enum { Restart = 1, RestartOther, Exit, Shutdown, Execute, Reconfigure, WindowShade, WindowIconify, WindowMaximize, WindowClose, WindowRaise, diff --git a/src/Window.cc b/src/Window.cc index 23bc9800..90224fe5 100644 --- a/src/Window.cc +++ b/src/Window.cc @@ -2542,6 +2542,12 @@ void BlackboxWindow::mapRequestEvent(const XMapRequestEvent *re) { XSync(blackbox->getXDisplay(), False); // make sure the frame is mapped.. setInputFocus(); } + int x, y, rx, ry; + Window c, r; + unsigned int m; + XQueryPointer(screen->getBlackbox()->getXDisplay(), screen->getRootWindow(), + &r, &c, &rx, &ry, &x, &y, &m); + beginMove(rx, ry); break; } } diff --git a/src/Workspace.cc b/src/Workspace.cc index 5c38cf05..4fd579e4 100644 --- a/src/Workspace.cc +++ b/src/Workspace.cc @@ -694,6 +694,7 @@ void Workspace::placeWindow(BlackboxWindow *win) { placed = smartPlacement(new_win, availableArea); break; case BScreen::UnderMousePlacement: + case BScreen::ClickMousePlacement: placed = underMousePlacement(new_win, availableArea); default: break; // handled below