Patch from Glen Whitney
A priori, there is no reason why the workspace warping functionality should treat the horizontal and vertical directions at all differently. Even if traditionally horizontal warping was more common, for some in recent times as aspect ratios tend to become larger, stacking virtual workspaces vertically may make more sense. Similarly, some might want to traverse an array of workspaces in column-major, rather than row-major, order. Prior to this commit, there were extra parameters for vertical warping (a controlling flag and an offset for how many workspaces to jump) as opposed to horizontal warping. Also it was impossible to allow vertical warping while disallowing vertical warping. This commit makes all of the parameters and behavior for horizontal and vertical warping equivalent. For backwards compatibility, there is an overarching flag controlling whether warping occurs at all, as well as a separate control flag and offset for each of horizontal and vertical warping. The relevant init file resources and default values are: session.screen0.workspaceWarping: true session.screen0.workspaceWarpingHorizontal: true session.screen0.workspaceWarpingVertical: true session.screen0.workspaceWarpingHorizontalOffset: 1 session.screen0.workspaceWarpingVerticalOffset: 1
This commit is contained in:
parent
0279936d83
commit
8bc11006a5
6 changed files with 25 additions and 8 deletions
|
@ -415,8 +415,12 @@ titlebars, not window contents.
|
||||||
only an outline of the window will be shown.
|
only an outline of the window will be shown.
|
||||||
|
|
||||||
*Workspace Warping*:::
|
*Workspace Warping*:::
|
||||||
If enabled, you can drag windows from one workspace to another. The previous
|
If enabled, you can drag windows from one workspace to another. There are
|
||||||
workspace is to the left, the next workspace is to the right.
|
parameters to set independently whether this warping happens horizontally
|
||||||
|
and/or vertically, and in each direction you can set the number of
|
||||||
|
workspaces to jump when warping (to allow for a virtual rectangular grid
|
||||||
|
of workspaces). When warping, lower-numbered workspaces are above/to the
|
||||||
|
left, and higher-numbered workspaces below/to the right.
|
||||||
|
|
||||||
Window Menu
|
Window Menu
|
||||||
~~~~~~~~~~~
|
~~~~~~~~~~~
|
||||||
|
|
|
@ -828,7 +828,12 @@ If enabled, you will see the window content while dragging it\&. Otherwise only
|
||||||
.PP
|
.PP
|
||||||
\fBWorkspace Warping\fR
|
\fBWorkspace Warping\fR
|
||||||
.RS 4
|
.RS 4
|
||||||
If enabled, you can drag windows from one workspace to another\&. The previous workspace is to the left, the next workspace is to the right\&.
|
If enabled, you can drag windows from one workspace to another\&. There are
|
||||||
|
parameters to set independently whether this warping happens horizontally
|
||||||
|
and/or vertically, and in each direction you can set the number of workspaces
|
||||||
|
to jump when warping (to allow for a virtual rectangular grid of
|
||||||
|
workspaces)\&. When warping, lower-numbered workspaces are above/to the left, and
|
||||||
|
higher-numbered workspaces below/to the right\&.
|
||||||
.RE
|
.RE
|
||||||
.SS "Window Menu"
|
.SS "Window Menu"
|
||||||
.sp
|
.sp
|
||||||
|
|
|
@ -95,7 +95,9 @@ public:
|
||||||
bool isRootColormapInstalled() const { return root_colormap_installed; }
|
bool isRootColormapInstalled() const { return root_colormap_installed; }
|
||||||
bool isScreenManaged() const { return m_state.managed; }
|
bool isScreenManaged() const { return m_state.managed; }
|
||||||
bool isWorkspaceWarping() const { return (m_workspaces_list.size() > 1) && *resource.workspace_warping; }
|
bool isWorkspaceWarping() const { return (m_workspaces_list.size() > 1) && *resource.workspace_warping; }
|
||||||
bool isWorkspaceWarpingVertical() const { return *resource.workspace_warping_vertical; }
|
bool isWorkspaceWarpingHorizontal() const { return isWorkspaceWarping() && *resource.workspace_warping_horizontal; }
|
||||||
|
bool isWorkspaceWarpingVertical() const { return isWorkspaceWarping() && *resource.workspace_warping_vertical; }
|
||||||
|
int getWorkspaceWarpingHorizontalOffset() const { return *resource.workspace_warping_horizontal_offset; }
|
||||||
int getWorkspaceWarpingVerticalOffset() const { return *resource.workspace_warping_vertical_offset; }
|
int getWorkspaceWarpingVerticalOffset() const { return *resource.workspace_warping_vertical_offset; }
|
||||||
bool doAutoRaise() const { return *resource.auto_raise; }
|
bool doAutoRaise() const { return *resource.auto_raise; }
|
||||||
bool clickRaises() const { return *resource.click_raises; }
|
bool clickRaises() const { return *resource.click_raises; }
|
||||||
|
|
|
@ -89,7 +89,9 @@ ScreenResource::ScreenResource(FbTk::ResourceManager& rm,
|
||||||
max_disable_move(rm, false, scrname+".maxDisableMove", altscrname+".MaxDisableMove"),
|
max_disable_move(rm, false, scrname+".maxDisableMove", altscrname+".MaxDisableMove"),
|
||||||
max_disable_resize(rm, false, scrname+".maxDisableResize", altscrname+".MaxDisableResize"),
|
max_disable_resize(rm, false, scrname+".maxDisableResize", altscrname+".MaxDisableResize"),
|
||||||
workspace_warping(rm, true, scrname+".workspacewarping", altscrname+".WorkspaceWarping"),
|
workspace_warping(rm, true, scrname+".workspacewarping", altscrname+".WorkspaceWarping"),
|
||||||
|
workspace_warping_horizontal(rm, true, scrname+".workspacewarpinghorizontal", altscrname+".WorkspaceWarpingHorizontal"),
|
||||||
workspace_warping_vertical(rm, true, scrname+".workspacewarpingvertical", altscrname+".WorkspaceWarpingVertical"),
|
workspace_warping_vertical(rm, true, scrname+".workspacewarpingvertical", altscrname+".WorkspaceWarpingVertical"),
|
||||||
|
workspace_warping_horizontal_offset(rm, 1, scrname+".workspacewarpinghorizontaloffset", altscrname+".WorkspaceWarpingHorizontalOffset"),
|
||||||
workspace_warping_vertical_offset(rm, 1, scrname+".workspacewarpingverticaloffset", altscrname+".WorkspaceWarpingVerticalOffset"),
|
workspace_warping_vertical_offset(rm, 1, scrname+".workspacewarpingverticaloffset", altscrname+".WorkspaceWarpingVerticalOffset"),
|
||||||
show_window_pos(rm, false, scrname+".showwindowposition", altscrname+".ShowWindowPosition"),
|
show_window_pos(rm, false, scrname+".showwindowposition", altscrname+".ShowWindowPosition"),
|
||||||
auto_raise(rm, true, scrname+".autoRaise", altscrname+".AutoRaise"),
|
auto_raise(rm, true, scrname+".autoRaise", altscrname+".AutoRaise"),
|
||||||
|
|
|
@ -38,6 +38,7 @@ struct ScreenResource {
|
||||||
max_disable_move,
|
max_disable_move,
|
||||||
max_disable_resize,
|
max_disable_resize,
|
||||||
workspace_warping,
|
workspace_warping,
|
||||||
|
workspace_warping_horizontal,
|
||||||
workspace_warping_vertical,
|
workspace_warping_vertical,
|
||||||
show_window_pos,
|
show_window_pos,
|
||||||
auto_raise,
|
auto_raise,
|
||||||
|
@ -56,7 +57,8 @@ struct ScreenResource {
|
||||||
menu_delay,
|
menu_delay,
|
||||||
tab_width,
|
tab_width,
|
||||||
tooltip_delay,
|
tooltip_delay,
|
||||||
workspace_warping_vertical_offset;
|
workspace_warping_horizontal_offset,
|
||||||
|
workspace_warping_vertical_offset;
|
||||||
FbTk::Resource<bool> allow_remote_actions;
|
FbTk::Resource<bool> allow_remote_actions;
|
||||||
FbTk::Resource<bool> clientmenu_use_pixmap;
|
FbTk::Resource<bool> clientmenu_use_pixmap;
|
||||||
FbTk::Resource<bool> tabs_use_pixmap;
|
FbTk::Resource<bool> tabs_use_pixmap;
|
||||||
|
|
|
@ -2578,6 +2578,7 @@ void FluxboxWindow::motionNotifyEvent(XMotionEvent &me) {
|
||||||
const int warp_pad = screen().getEdgeSnapThreshold();
|
const int warp_pad = screen().getEdgeSnapThreshold();
|
||||||
const int workspaces = screen().numberOfWorkspaces();
|
const int workspaces = screen().numberOfWorkspaces();
|
||||||
const bool is_warping = screen().isWorkspaceWarping();
|
const bool is_warping = screen().isWorkspaceWarping();
|
||||||
|
const bool is_warping_horzntal = screen().isWorkspaceWarpingHorizontal();
|
||||||
const bool is_warping_vertical = screen().isWorkspaceWarpingVertical();
|
const bool is_warping_vertical = screen().isWorkspaceWarpingVertical();
|
||||||
|
|
||||||
if ((moved_x || moved_y) && is_warping) {
|
if ((moved_x || moved_y) && is_warping) {
|
||||||
|
@ -2590,12 +2591,13 @@ void FluxboxWindow::motionNotifyEvent(XMotionEvent &me) {
|
||||||
int bt_top = int(screen().height()) - warp_pad - 1;
|
int bt_top = int(screen().height()) - warp_pad - 1;
|
||||||
int bt_bottom = warp_pad;
|
int bt_bottom = warp_pad;
|
||||||
|
|
||||||
if (moved_x) {
|
if (moved_x && is_warping_horzntal) {
|
||||||
|
const int warp_offset = screen().getWorkspaceWarpingHorizontalOffset();
|
||||||
if (me.x_root >= bt_right && moved_x > 0) { //warp right
|
if (me.x_root >= bt_right && moved_x > 0) { //warp right
|
||||||
new_id = (cur_id + 1) % workspaces;
|
new_id = (cur_id + warp_offset) % workspaces;
|
||||||
m_last_resize_x = 0;
|
m_last_resize_x = 0;
|
||||||
} else if (me.x_root <= bt_left && moved_x < 0) { //warp left
|
} else if (me.x_root <= bt_left && moved_x < 0) { //warp left
|
||||||
new_id = (cur_id + -1) % workspaces;
|
new_id = (cur_id + workspaces - warp_offset) % workspaces;
|
||||||
m_last_resize_x = screen().width() - 1;
|
m_last_resize_x = screen().width() - 1;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue