The default value for both parameters is 20 pixels.
+*<resistance><unSnapThreshold>*
+ Sets the movement of cursor in pixel required for a tiled or maximized
+ window to be moved with an interactive move. Default is 20.
+
## FOCUS
*<focus><followMouse>* [yes|no]
SnapToEdge action for that edge. A *range* of 0 disables snapping via
interactive moves. Default is 1.
-*<snapping><dragResistance>*
- Sets the movement of cursor in pixel required for a tiled or maximized
- window to be moved with an interactive move. Default is 20.
-
*<snapping><overlay><enabled>* [yes|no]
Show an overlay when snapping to a window to an edge. Default is yes.
<resistance>
<screenEdgeStrength>20</screenEdgeStrength>
<windowEdgeStrength>20</windowEdgeStrength>
+ <unSnapThreshold>20</unSnapThreshold>
</resistance>
<resize>
<snapping>
<!-- Set range to 0 to disable window snapping completely -->
<range>1</range>
- <dragResistance>20</dragResistance>
<overlay enabled="yes">
<delay inner="500" outer="500" />
</overlay>
/* resistance */
int screen_edge_strength;
int window_edge_strength;
+ int unsnap_threshold;
/* window snapping */
int snap_edge_range;
int snap_overlay_delay_outer;
bool snap_top_maximize;
enum tiling_events_mode snap_tiling_events_mode;
- int snap_drag_resistance;
enum resize_indicator_mode resize_indicator;
bool resize_draw_contents;
* geometry->{width,height} are provided by the caller.
* geometry->{x,y} are computed by this function.
*
- * @note When drag-resistance is used, cursor_x/y should be the original
+ * @note When <unSnapThreshold> is non-zero, cursor_x/y should be the original
* cursor position when the button was pressed.
*/
void interactive_anchor_to_cursor(struct view *view, struct wlr_box *geometry,
* interactive_move_tiled_view_to() - Un-tile the tiled/maximized view at the
* start of an interactive move or when an interactive move is pending.
* Returns true if the distance of cursor motion exceeds the value of
- * <snapping><dragResistance> and the view is un-tiled.
+ * <resistance><unSnapThreshold> and the view is un-tiled.
*/
bool interactive_move_tiled_view_to(struct server *server, struct view *view,
struct wlr_box *geometry);
rc.screen_edge_strength = atoi(content);
} else if (!strcasecmp(nodename, "windowEdgeStrength.resistance")) {
rc.window_edge_strength = atoi(content);
+ } else if (!strcasecmp(nodename, "unSnapThreshold.resistance")) {
+ rc.unsnap_threshold = atoi(content);
} else if (!strcasecmp(nodename, "range.snapping")) {
rc.snap_edge_range = atoi(content);
} else if (!strcasecmp(nodename, "enabled.overlay.snapping")) {
} else {
wlr_log(WLR_ERROR, "ignoring invalid value for notifyClient");
}
- } else if (!strcasecmp(nodename, "dragResistance.snapping")) {
- rc.snap_drag_resistance = atoi(content);
/* <windowSwitcher show="" preview="" outlines="" /> */
} else if (!strcasecmp(nodename, "show.windowSwitcher")) {
rc.kb_layout_per_window = false;
rc.screen_edge_strength = 20;
rc.window_edge_strength = 20;
+ rc.unsnap_threshold = 20;
rc.snap_edge_range = 1;
rc.snap_overlay_enabled = true;
rc.snap_overlay_delay_outer = 500;
rc.snap_top_maximize = true;
rc.snap_tiling_events_mode = LAB_TILING_EVENTS_ALWAYS;
- rc.snap_drag_resistance = 20;
rc.window_switcher.show = true;
rc.window_switcher.preview = true;
/*
* Un-tile the view when interactive move is delayed and the distance
- * of cursor movement exceeds <snapping><dragResistance>.
+ * of cursor movement exceeds <resistance><unSnapThreshold>.
*/
if (server->move_pending && !interactive_move_tiled_view_to(
server, server->grabbed_view, &server->grab_box)) {
{
assert(!view_is_floating(view));
- int resistance = rc.snap_drag_resistance;
+ int threshold = rc.unsnap_threshold;
if (server->input_mode == LAB_INPUT_STATE_MOVE) {
/* When called from cursor motion handler */
double dx = server->seat.cursor->x - server->grab_x;
double dy = server->seat.cursor->y - server->grab_y;
- if (dx * dx + dy * dy < resistance * resistance) {
+ if (dx * dx + dy * dy < threshold * threshold) {
return false;
}
} else {
/* When called from interactive_begin() */
- if (resistance > 0) {
+ if (threshold > 0) {
return false;
}
}
}
/*
- * If <snapping><dragResistance> is non-zero, the
+ * If <resistance><unSnapThreshold> is non-zero, the
* tiled/maximized view is un-tiled later in cursor
* motion handler.
*/