Changelog for Openbox:
1.1.0:
+ * added ClickMouse window placement algorithm/type. (Ben Jansens)
+
* added UnderMouse window placement algorithm/type. (Ben Jansens)
1.0.0:
# Best Fit Placement
$ #UnderMouse
# Under Mouse Placement
+$ #ClickMouse
+# Click Mouse Placement
$ #LeftRight
# Left to Right
$ #RightLeft
insert(i18n->getMessage(ConfigmenuSet, ConfigmenuUnderMouse,
"Under Mouse Placement"),
BScreen::UnderMousePlacement);
+ insert(i18n->getMessage(ConfigmenuSet, ConfigmenuClickMouse,
+ "Click Mouse Placement"),
+ BScreen::ClickMousePlacement);
insert(i18n->getMessage(ConfigmenuSet, ConfigmenuLeftRight,
"Left to Right"), BScreen::LeftRight);
insert(i18n->getMessage(ConfigmenuSet, ConfigmenuRightLeft,
setItemSelected(2, p == BScreen::CascadePlacement);
setItemSelected(3, p == BScreen::BestFitPlacement);
setItemSelected(4, p == BScreen::UnderMousePlacement);
+ setItemSelected(5, p == BScreen::ClickMousePlacement);
bool rl = (configmenu->screen.rowPlacementDirection() ==
BScreen::LeftRight),
tb = (configmenu->screen.colPlacementDirection() ==
BScreen::TopBottom);
- setItemSelected(5, rl);
- setItemEnabled(5, p != BScreen::UnderMousePlacement);
- setItemSelected(6, !rl);
- setItemEnabled(6, p != BScreen::UnderMousePlacement);
-
- setItemSelected(7, tb);
- setItemEnabled(7, p != BScreen::UnderMousePlacement);
- setItemSelected(8, !tb);
- setItemEnabled(8, p != BScreen::UnderMousePlacement);
+ setItemSelected(6, rl);
+ setItemEnabled(6, (p != BScreen::UnderMousePlacement &&
+ p != BScreen::ClickMousePlacement));
+ setItemSelected(7, !rl);
+ setItemEnabled(7, (p != BScreen::UnderMousePlacement &&
+ p != BScreen::ClickMousePlacement));
+
+ setItemSelected(8, tb);
+ setItemEnabled(8, (p != BScreen::UnderMousePlacement &&
+ p != BScreen::ClickMousePlacement));
+ setItemSelected(9, !tb);
+ setItemEnabled(9, (p != BScreen::UnderMousePlacement &&
+ p != BScreen::ClickMousePlacement));
}
void Configmenu::Placementmenu::reconfigure() {
configmenu->screen.setPlacementPolicy(item->function());
break;
+ case BScreen::ClickMousePlacement:
+ configmenu->screen.setPlacementPolicy(item->function());
+ break;
+
case BScreen::LeftRight:
configmenu->screen.setRowPlacementDirection(BScreen::LeftRight);
break;
case BestFitPlacement: placement = "BestFitPlacement"; break;
case ColSmartPlacement: placement = "ColSmartPlacement"; break;
case UnderMousePlacement: placement = "UnderMousePlacement"; break;
+ case ClickMousePlacement: placement = "ClickMousePlacement"; break;
default:
case RowSmartPlacement: placement = "RowSmartPlacement"; break;
}
resource.placement_policy = BestFitPlacement;
else if (0 == strncasecmp(s.c_str(), "UnderMousePlacement", s.length()))
resource.placement_policy = UnderMousePlacement;
+ else if (0 == strncasecmp(s.c_str(), "ClickMousePlacement", s.length()))
+ resource.placement_policy = ClickMousePlacement;
else //if (0 == strncasecmp(s.c_str(), "CascadePlacement", s.length()))
resource.placement_policy = CascadePlacement;
} else
void updateNetizenWindowLower(Window);
enum { RowSmartPlacement = 1, ColSmartPlacement, CascadePlacement,
- BestFitPlacement, UnderMousePlacement,
+ BestFitPlacement, UnderMousePlacement, ClickMousePlacement,
LeftRight, RightLeft, TopBottom, BottomTop };
enum { LeftJustify = 1, RightJustify, CenterJustify };
enum { RoundBullet = 1, TriangleBullet, SquareBullet, NoBullet };
void OpenboxWindow::startMove(int x, int y) {
ASSERT(!flags.moving);
- XGrabPointer(display, frame.window, False, Button1MotionMask |
+ XGrabPointer(display, frame.window, False, PointerMotionMask |
ButtonReleaseMask, GrabModeAsync, GrabModeAsync,
None, openbox.getMoveCursor(), CurrentTime);
void OpenboxWindow::motionNotifyEvent(XMotionEvent *me) {
- if (!flags.resizing && (me->state & Button1Mask) && functions.move &&
- (frame.title == me->window || frame.label == me->window ||
- frame.handle == me->window || frame.window == me->window)) {
- if (!flags.moving)
- startMove(me->x_root, me->y_root);
- else
+ if (flags.moving)
doMove(me->x_root, me->y_root);
- } else if (functions.resize &&
+ else if (!flags.resizing && (me->state & Button1Mask) && functions.move &&
+ (frame.title == me->window || frame.label == me->window ||
+ frame.handle == me->window || frame.window == me->window))
+ startMove(me->x_root, me->y_root);
+ else if (functions.resize &&
(((me->state & Button1Mask) && (me->window == frame.right_grip ||
me->window == frame.left_grip)) ||
(me->state & (Mod1Mask | Button3Mask) &&
place = colSmartPlacement(window_size, space);
break;
case BScreen::UnderMousePlacement:
+ case BScreen::ClickMousePlacement:
place = underMousePlacement(window_size, space);
break;
} // switch
if (! win)
win = new OpenboxWindow(*this, e->xmaprequest.window);
- if ((win = searchWindow(e->xmaprequest.window)))
+ if ((win = searchWindow(e->xmaprequest.window))) {
win->mapRequestEvent(&e->xmaprequest);
-
+ // if we're using the click to place placement type, then immediately
+ // after the window is mapped, we need to start interactively moving it
+ if (win->getScreen()->placementPolicy() == BScreen::ClickMousePlacement) {
+ int x, y, rx, ry;
+ Window c, r;
+ unsigned int m;
+ XQueryPointer(getXDisplay(), win->getScreen()->getRootWindow(),
+ &r, &c, &rx, &ry, &x, &y, &m);
+ win->startMove(rx, ry);
+ }
+ }
break;
}