synch with bb-cvs.
add window resize zones. the resource has been renamed from windowZones to resizeZones.
This commit is contained in:
parent
8e34bfcfcb
commit
0c04fb5260
3 changed files with 48 additions and 15 deletions
|
@ -412,6 +412,12 @@ void BScreen::saveWindowToWindowSnap(bool s) {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void BScreen::saveResizeZones(unsigned int z) {
|
||||||
|
resource.resize_zones = z;
|
||||||
|
config->setValue(screenstr + "resizeZones", resource.resize_zones);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
void BScreen::saveWindowCornerSnap(bool s) {
|
void BScreen::saveWindowCornerSnap(bool s) {
|
||||||
resource.window_corner_snap = s;
|
resource.window_corner_snap = s;
|
||||||
config->setValue(screenstr + "windowCornerSnap",
|
config->setValue(screenstr + "windowCornerSnap",
|
||||||
|
@ -505,6 +511,7 @@ void BScreen::save_rc(void) {
|
||||||
saveAutoRaise(resource.auto_raise);
|
saveAutoRaise(resource.auto_raise);
|
||||||
saveImageDither(doImageDither());
|
saveImageDither(doImageDither());
|
||||||
saveAAFonts(resource.aa_fonts);
|
saveAAFonts(resource.aa_fonts);
|
||||||
|
saveResizeZones(resource.resize_zones);
|
||||||
saveOpaqueMove(resource.opaque_move);
|
saveOpaqueMove(resource.opaque_move);
|
||||||
saveFullMax(resource.full_max);
|
saveFullMax(resource.full_max);
|
||||||
saveFocusNew(resource.focus_new);
|
saveFocusNew(resource.focus_new);
|
||||||
|
@ -551,6 +558,11 @@ void BScreen::load_rc(void) {
|
||||||
if (! config->getValue(screenstr + "antialiasFonts", resource.aa_fonts))
|
if (! config->getValue(screenstr + "antialiasFonts", resource.aa_fonts))
|
||||||
resource.aa_fonts = true;
|
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))
|
if (! config->getValue(screenstr + "hideToolbar", resource.hide_toolbar))
|
||||||
resource.hide_toolbar = false;
|
resource.hide_toolbar = false;
|
||||||
|
|
||||||
|
|
|
@ -156,7 +156,8 @@ private:
|
||||||
int toolbar_placement, toolbar_width_percent, placement_policy,
|
int toolbar_placement, toolbar_width_percent, placement_policy,
|
||||||
edge_snap_threshold, row_direction, col_direction;
|
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
|
#ifdef HAVE_STRFTIME
|
||||||
std::string strftime_format;
|
std::string strftime_format;
|
||||||
|
@ -241,6 +242,8 @@ public:
|
||||||
{ return resource.frame_width; }
|
{ return resource.frame_width; }
|
||||||
inline unsigned int getBorderWidth(void) const
|
inline unsigned int getBorderWidth(void) const
|
||||||
{ return resource.border_width; }
|
{ return resource.border_width; }
|
||||||
|
inline unsigned int getResizeZones(void) const
|
||||||
|
{ return resource.resize_zones; }
|
||||||
|
|
||||||
inline unsigned int getCurrentWorkspaceID(void)
|
inline unsigned int getCurrentWorkspaceID(void)
|
||||||
{ return current_workspace->getID(); }
|
{ return current_workspace->getID(); }
|
||||||
|
@ -276,6 +279,7 @@ public:
|
||||||
void saveHideToolbar(bool h);
|
void saveHideToolbar(bool h);
|
||||||
void saveWindowToWindowSnap(bool s);
|
void saveWindowToWindowSnap(bool s);
|
||||||
void saveWindowCornerSnap(bool s);
|
void saveWindowCornerSnap(bool s);
|
||||||
|
void saveResizeZones(unsigned int z);
|
||||||
inline void iconUpdate(void) { iconmenu->update(); }
|
inline void iconUpdate(void) { iconmenu->update(); }
|
||||||
|
|
||||||
#ifdef HAVE_STRFTIME
|
#ifdef HAVE_STRFTIME
|
||||||
|
|
|
@ -252,8 +252,7 @@ BlackboxWindow::BlackboxWindow(Blackbox *b, Window w, BScreen *s) {
|
||||||
client.normal_hint_flags & (PPosition|USPosition)) {
|
client.normal_hint_flags & (PPosition|USPosition)) {
|
||||||
applyGravity(frame.rect);
|
applyGravity(frame.rect);
|
||||||
|
|
||||||
if (blackbox->isStartup() ||
|
if (blackbox->isStartup() || client.rect.intersects(screen->getRect()))
|
||||||
client.rect.intersects(screen->availableArea()))
|
|
||||||
place_window = False;
|
place_window = False;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -816,7 +815,9 @@ void BlackboxWindow::positionButtons(bool redecorate_label) {
|
||||||
|
|
||||||
|
|
||||||
void BlackboxWindow::reconfigure(void) {
|
void BlackboxWindow::reconfigure(void) {
|
||||||
|
restoreGravity(client.rect);
|
||||||
upsize();
|
upsize();
|
||||||
|
applyGravity(frame.rect);
|
||||||
positionWindows();
|
positionWindows();
|
||||||
decorate();
|
decorate();
|
||||||
redrawWindowFrame();
|
redrawWindowFrame();
|
||||||
|
@ -845,8 +846,7 @@ void BlackboxWindow::grabButtons(void) {
|
||||||
if (functions & Func_Resize)
|
if (functions & Func_Resize)
|
||||||
blackbox->grabButton(Button3, Mod1Mask, frame.window, True,
|
blackbox->grabButton(Button3, Mod1Mask, frame.window, True,
|
||||||
ButtonReleaseMask | ButtonMotionMask, GrabModeAsync,
|
ButtonReleaseMask | ButtonMotionMask, GrabModeAsync,
|
||||||
GrabModeAsync, frame.window,
|
GrabModeAsync, frame.window, None);
|
||||||
blackbox->getLowerRightAngleCursor());
|
|
||||||
// alt+middle lowers the window
|
// alt+middle lowers the window
|
||||||
blackbox->grabButton(Button2, Mod1Mask, frame.window, True,
|
blackbox->grabButton(Button2, Mod1Mask, frame.window, True,
|
||||||
ButtonReleaseMask, GrabModeAsync, GrabModeAsync,
|
ButtonReleaseMask, GrabModeAsync, GrabModeAsync,
|
||||||
|
@ -2759,7 +2759,7 @@ void BlackboxWindow::buttonPressEvent(const XButtonEvent *be) {
|
||||||
if (frame.title == be->window || frame.label == be->window) {
|
if (frame.title == be->window || frame.label == be->window) {
|
||||||
if (((be->time - lastButtonPressTime) <=
|
if (((be->time - lastButtonPressTime) <=
|
||||||
blackbox->getDoubleClickInterval()) ||
|
blackbox->getDoubleClickInterval()) ||
|
||||||
(be->state & ControlMask)) {
|
(be->state == ControlMask)) {
|
||||||
lastButtonPressTime = 0;
|
lastButtonPressTime = 0;
|
||||||
shade();
|
shade();
|
||||||
} else {
|
} else {
|
||||||
|
@ -3270,19 +3270,36 @@ void BlackboxWindow::motionNotifyEvent(const XMotionEvent *me) {
|
||||||
} else if (flags.resizing) {
|
} else if (flags.resizing) {
|
||||||
doResize(me->x_root, me->y_root);
|
doResize(me->x_root, me->y_root);
|
||||||
} else {
|
} else {
|
||||||
if (! flags.resizing && (me->state & Button1Mask) &&
|
if (!flags.resizing && me->state & Button1Mask && (functions & Func_Move) &&
|
||||||
(functions & Func_Move) &&
|
|
||||||
(frame.title == me->window || frame.label == me->window ||
|
(frame.title == me->window || frame.label == me->window ||
|
||||||
frame.handle == me->window || frame.window == me->window)) {
|
frame.handle == me->window || frame.window == me->window)) {
|
||||||
beginMove(me->x_root, me->y_root);
|
beginMove(me->x_root, me->y_root);
|
||||||
} else if ((functions & Func_Resize) &&
|
} else if ((functions & Func_Resize) &&
|
||||||
(((me->state & Button1Mask) &&
|
(me->state & Button1Mask && (me->window == frame.right_grip ||
|
||||||
(me->window == frame.right_grip ||
|
me->window == frame.left_grip)) ||
|
||||||
me->window == frame.left_grip)) ||
|
(me->state & Button3Mask && me->state & Mod1Mask &&
|
||||||
(me->state & (Mod1Mask | Button3Mask) &&
|
me->window == frame.window)) {
|
||||||
me->window == frame.window))) {
|
unsigned int zones = screen->getResizeZones();
|
||||||
beginResize(me->x_root, me->y_root,
|
Corner corner;
|
||||||
(me->window == frame.left_grip) ? BottomLeft : BottomRight);
|
|
||||||
|
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);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue