add rc option for workspaceWarping
This commit is contained in:
parent
a41a0c1ac8
commit
be306f6b60
3 changed files with 66 additions and 48 deletions
|
@ -537,6 +537,13 @@ void BScreen::saveAllowScrollLock(bool a) {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void BScreen::saveWorkspaceWarping(bool w) {
|
||||||
|
resource.workspace_warping = w;
|
||||||
|
config->setValue(screenstr + "workspaceWarping",
|
||||||
|
resource.workspace_warping);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
void BScreen::save_rc(void) {
|
void BScreen::save_rc(void) {
|
||||||
saveSloppyFocus(resource.sloppy_focus);
|
saveSloppyFocus(resource.sloppy_focus);
|
||||||
saveAutoRaise(resource.auto_raise);
|
saveAutoRaise(resource.auto_raise);
|
||||||
|
@ -564,6 +571,7 @@ void BScreen::save_rc(void) {
|
||||||
savePlaceIgnoreShaded(resource.ignore_shaded);
|
savePlaceIgnoreShaded(resource.ignore_shaded);
|
||||||
savePlaceIgnoreMaximized(resource.ignore_maximized);
|
savePlaceIgnoreMaximized(resource.ignore_maximized);
|
||||||
saveAllowScrollLock(resource.allow_scroll_lock);
|
saveAllowScrollLock(resource.allow_scroll_lock);
|
||||||
|
saveWorkspaceWarping(resource.workspace_warping);
|
||||||
|
|
||||||
toolbar->save_rc();
|
toolbar->save_rc();
|
||||||
slit->save_rc();
|
slit->save_rc();
|
||||||
|
@ -699,9 +707,13 @@ void BScreen::load_rc(void) {
|
||||||
resource.ignore_maximized))
|
resource.ignore_maximized))
|
||||||
resource.ignore_maximized = true;
|
resource.ignore_maximized = true;
|
||||||
|
|
||||||
if (! config->getValue(screenstr + "disableBindingsWithScrollLock",
|
if (! config->getValue(screenstr + "disableBindingsWithScrollLock",
|
||||||
resource.allow_scroll_lock))
|
resource.allow_scroll_lock))
|
||||||
resource.allow_scroll_lock = false;
|
resource.allow_scroll_lock = false;
|
||||||
|
|
||||||
|
if (! config->getValue(screenstr + "workspaceWarping",
|
||||||
|
resource.workspace_warping))
|
||||||
|
resource.workspace_warping = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -148,7 +148,8 @@ private:
|
||||||
bool sloppy_focus, auto_raise, auto_edge_balance, ordered_dither,
|
bool sloppy_focus, auto_raise, auto_edge_balance, ordered_dither,
|
||||||
opaque_move, full_max, focus_new, focus_last, click_raise,
|
opaque_move, full_max, focus_new, focus_last, click_raise,
|
||||||
allow_scroll_lock, hide_toolbar, window_to_window_snap,
|
allow_scroll_lock, hide_toolbar, window_to_window_snap,
|
||||||
window_corner_snap, aa_fonts, ignore_shaded, ignore_maximized;
|
window_corner_snap, aa_fonts, ignore_shaded, ignore_maximized,
|
||||||
|
workspace_warping;
|
||||||
BColor border_color;
|
BColor border_color;
|
||||||
|
|
||||||
unsigned int workspaces;
|
unsigned int workspaces;
|
||||||
|
@ -218,6 +219,8 @@ public:
|
||||||
inline bool getWindowCornerSnap(void) const
|
inline bool getWindowCornerSnap(void) const
|
||||||
{ return resource.window_corner_snap; }
|
{ return resource.window_corner_snap; }
|
||||||
inline bool allowScrollLock(void) const { return resource.allow_scroll_lock; }
|
inline bool allowScrollLock(void) const { return resource.allow_scroll_lock; }
|
||||||
|
inline bool doWorkspaceWarping(void) const
|
||||||
|
{ return resource.workspace_warping; }
|
||||||
|
|
||||||
inline const GC &getOpGC(void) const { return opGC; }
|
inline const GC &getOpGC(void) const { return opGC; }
|
||||||
|
|
||||||
|
@ -290,6 +293,7 @@ public:
|
||||||
void savePlaceIgnoreShaded(bool i);
|
void savePlaceIgnoreShaded(bool i);
|
||||||
void savePlaceIgnoreMaximized(bool i);
|
void savePlaceIgnoreMaximized(bool i);
|
||||||
void saveAllowScrollLock(bool a);
|
void saveAllowScrollLock(bool a);
|
||||||
|
void saveWorkspaceWarping(bool w);
|
||||||
inline void iconUpdate(void) { iconmenu->update(); }
|
inline void iconUpdate(void) { iconmenu->update(); }
|
||||||
|
|
||||||
#ifdef HAVE_STRFTIME
|
#ifdef HAVE_STRFTIME
|
||||||
|
|
|
@ -2962,55 +2962,57 @@ void BlackboxWindow::doMove(int x_root, int y_root) {
|
||||||
dx -= frame.border_w;
|
dx -= frame.border_w;
|
||||||
dy -= frame.border_w;
|
dy -= frame.border_w;
|
||||||
|
|
||||||
// workspace warping
|
if (screen->doWorkspaceWarping()) {
|
||||||
bool warp = False;
|
// workspace warping
|
||||||
unsigned int dest = screen->getCurrentWorkspaceID();
|
bool warp = False;
|
||||||
if (x_root <= 0) {
|
unsigned int dest = screen->getCurrentWorkspaceID();
|
||||||
warp = True;
|
|
||||||
|
|
||||||
if (dest > 0) dest--;
|
|
||||||
else dest = screen->getNumberOfWorkspaces() - 1;
|
|
||||||
|
|
||||||
} else if (x_root >= screen->getRect().right()) {
|
|
||||||
warp = True;
|
|
||||||
|
|
||||||
if (dest < screen->getNumberOfWorkspaces() - 1) dest++;
|
|
||||||
else dest = 0;
|
|
||||||
}
|
|
||||||
if (warp) {
|
|
||||||
endMove();
|
|
||||||
bool focus = flags.focused; // had focus while moving?
|
|
||||||
if (! flags.stuck)
|
|
||||||
screen->reassociateWindow(this, dest, False);
|
|
||||||
screen->changeWorkspaceID(dest);
|
|
||||||
if (focus)
|
|
||||||
setInputFocus();
|
|
||||||
|
|
||||||
/*
|
|
||||||
If the XWarpPointer is done after the configure, we can end up
|
|
||||||
grabbing another window, so made sure you do it first.
|
|
||||||
*/
|
|
||||||
int dest_x;
|
|
||||||
if (x_root <= 0) {
|
if (x_root <= 0) {
|
||||||
dest_x = screen->getRect().right() - 1;
|
warp = True;
|
||||||
XWarpPointer(blackbox->getXDisplay(), None,
|
|
||||||
screen->getRootWindow(), 0, 0, 0, 0,
|
|
||||||
dest_x, y_root);
|
|
||||||
|
|
||||||
configure(dx + (screen->getRect().width() - 1), dy,
|
if (dest > 0) dest--;
|
||||||
frame.rect.width(), frame.rect.height());
|
else dest = screen->getNumberOfWorkspaces() - 1;
|
||||||
} else {
|
|
||||||
dest_x = 0;
|
|
||||||
XWarpPointer(blackbox->getXDisplay(), None,
|
|
||||||
screen->getRootWindow(), 0, 0, 0, 0,
|
|
||||||
dest_x, y_root);
|
|
||||||
|
|
||||||
configure(dx - (screen->getRect().width() - 1), dy,
|
} else if (x_root >= screen->getRect().right()) {
|
||||||
frame.rect.width(), frame.rect.height());
|
warp = True;
|
||||||
|
|
||||||
|
if (dest < screen->getNumberOfWorkspaces() - 1) dest++;
|
||||||
|
else dest = 0;
|
||||||
}
|
}
|
||||||
|
if (warp) {
|
||||||
|
endMove();
|
||||||
|
bool focus = flags.focused; // had focus while moving?
|
||||||
|
if (! flags.stuck)
|
||||||
|
screen->reassociateWindow(this, dest, False);
|
||||||
|
screen->changeWorkspaceID(dest);
|
||||||
|
if (focus)
|
||||||
|
setInputFocus();
|
||||||
|
|
||||||
beginMove(dest_x, y_root);
|
/*
|
||||||
return;
|
If the XWarpPointer is done after the configure, we can end up
|
||||||
|
grabbing another window, so made sure you do it first.
|
||||||
|
*/
|
||||||
|
int dest_x;
|
||||||
|
if (x_root <= 0) {
|
||||||
|
dest_x = screen->getRect().right() - 1;
|
||||||
|
XWarpPointer(blackbox->getXDisplay(), None,
|
||||||
|
screen->getRootWindow(), 0, 0, 0, 0,
|
||||||
|
dest_x, y_root);
|
||||||
|
|
||||||
|
configure(dx + (screen->getRect().width() - 1), dy,
|
||||||
|
frame.rect.width(), frame.rect.height());
|
||||||
|
} else {
|
||||||
|
dest_x = 0;
|
||||||
|
XWarpPointer(blackbox->getXDisplay(), None,
|
||||||
|
screen->getRootWindow(), 0, 0, 0, 0,
|
||||||
|
dest_x, y_root);
|
||||||
|
|
||||||
|
configure(dx - (screen->getRect().width() - 1), dy,
|
||||||
|
frame.rect.width(), frame.rect.height());
|
||||||
|
}
|
||||||
|
|
||||||
|
beginMove(dest_x, y_root);
|
||||||
|
return;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
const int snap_distance = screen->getEdgeSnapThreshold();
|
const int snap_distance = screen->getEdgeSnapThreshold();
|
||||||
|
|
Loading…
Reference in a new issue