}
+void BScreen::saveResizeZones(unsigned int z) {
+ resource.resize_zones = z;
+ config->setValue(screenstr + "resizeZones", resource.resize_zones);
+}
+
+
void BScreen::saveWindowCornerSnap(bool s) {
resource.window_corner_snap = s;
config->setValue(screenstr + "windowCornerSnap",
saveAutoRaise(resource.auto_raise);
saveImageDither(doImageDither());
saveAAFonts(resource.aa_fonts);
+ saveResizeZones(resource.resize_zones);
saveOpaqueMove(resource.opaque_move);
saveFullMax(resource.full_max);
saveFocusNew(resource.focus_new);
if (! config->getValue(screenstr + "antialiasFonts", resource.aa_fonts))
resource.aa_fonts = true;
+ if (! config->getValue(screenstr + "resizeZones", resource.resize_zones) ||
+ (resource.resize_zones != 1 && resource.resize_zones != 2 &&
+ resource.resize_zones != 4))
+ resource.resize_zones = 4;
+
if (! config->getValue(screenstr + "hideToolbar", resource.hide_toolbar))
resource.hide_toolbar = false;
int toolbar_placement, toolbar_width_percent, placement_policy,
edge_snap_threshold, row_direction, col_direction;
- unsigned int handle_width, bevel_width, frame_width, border_width;
+ unsigned int handle_width, bevel_width, frame_width, border_width,
+ resize_zones;
#ifdef HAVE_STRFTIME
std::string strftime_format;
{ return resource.frame_width; }
inline unsigned int getBorderWidth(void) const
{ return resource.border_width; }
+ inline unsigned int getResizeZones(void) const
+ { return resource.resize_zones; }
inline unsigned int getCurrentWorkspaceID(void)
{ return current_workspace->getID(); }
void saveHideToolbar(bool h);
void saveWindowToWindowSnap(bool s);
void saveWindowCornerSnap(bool s);
+ void saveResizeZones(unsigned int z);
inline void iconUpdate(void) { iconmenu->update(); }
#ifdef HAVE_STRFTIME
client.normal_hint_flags & (PPosition|USPosition)) {
applyGravity(frame.rect);
- if (blackbox->isStartup() ||
- client.rect.intersects(screen->availableArea()))
+ if (blackbox->isStartup() || client.rect.intersects(screen->getRect()))
place_window = False;
}
void BlackboxWindow::reconfigure(void) {
+ restoreGravity(client.rect);
upsize();
+ applyGravity(frame.rect);
positionWindows();
decorate();
redrawWindowFrame();
if (functions & Func_Resize)
blackbox->grabButton(Button3, Mod1Mask, frame.window, True,
ButtonReleaseMask | ButtonMotionMask, GrabModeAsync,
- GrabModeAsync, frame.window,
- blackbox->getLowerRightAngleCursor());
+ GrabModeAsync, frame.window, None);
// alt+middle lowers the window
blackbox->grabButton(Button2, Mod1Mask, frame.window, True,
ButtonReleaseMask, GrabModeAsync, GrabModeAsync,
if (frame.title == be->window || frame.label == be->window) {
if (((be->time - lastButtonPressTime) <=
blackbox->getDoubleClickInterval()) ||
- (be->state & ControlMask)) {
+ (be->state == ControlMask)) {
lastButtonPressTime = 0;
shade();
} else {
} else if (flags.resizing) {
doResize(me->x_root, me->y_root);
} else {
- if (! flags.resizing && (me->state & Button1Mask) &&
- (functions & Func_Move) &&
+ if (!flags.resizing && me->state & Button1Mask && (functions & Func_Move) &&
(frame.title == me->window || frame.label == me->window ||
frame.handle == me->window || frame.window == me->window)) {
beginMove(me->x_root, me->y_root);
} else if ((functions & Func_Resize) &&
- (((me->state & Button1Mask) &&
- (me->window == frame.right_grip ||
- me->window == frame.left_grip)) ||
- (me->state & (Mod1Mask | Button3Mask) &&
- me->window == frame.window))) {
- beginResize(me->x_root, me->y_root,
- (me->window == frame.left_grip) ? BottomLeft : BottomRight);
+ (me->state & Button1Mask && (me->window == frame.right_grip ||
+ me->window == frame.left_grip)) ||
+ (me->state & Button3Mask && me->state & Mod1Mask &&
+ me->window == frame.window)) {
+ unsigned int zones = screen->getResizeZones();
+ Corner corner;
+
+ if (me->window == frame.left_grip) {
+ corner = BottomLeft;
+ } else if (me->window == frame.right_grip || zones == 1) {
+ corner = BottomRight;
+ } else {
+ bool top;
+ bool left = (me->x_root - frame.rect.x() <=
+ static_cast<signed>(frame.rect.width() / 2));
+ if (zones == 2)
+ top = False;
+ else // (zones == 4)
+ top = (me->y_root - frame.rect.y() <=
+ static_cast<signed>(frame.rect.height() / 2));
+ corner = (top ? (left ? TopLeft : TopRight) :
+ (left ? BottomLeft : BottomRight));
+ }
+
+ beginResize(me->x_root, me->y_root, corner);
}
}
}