Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 11 additions & 0 deletions data/org.cinnamon.muffin.gschema.xml.in
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,17 @@
</description>
</key>

<key name="edge-resistance-window" type="b">
<default>true</default>
<summary>Enable edge resistance between windows</summary>
<description>
If enabled, windows resist movement when their edges approach the
edges of other windows. Disabling this allows windows to be dragged
freely past one another without any sticky edge effect. Resistance
against monitor and screen boundaries is not affected by this setting.
</description>
</key>

<key name="tile-maximize" type="b">
<default>false</default>
<summary>Sets maximize as the tile action for the top edge of the screen</summary>
Expand Down
4 changes: 3 additions & 1 deletion src/core/edge-resistance.c
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@
#include "core/display-private.h"
#include "core/meta-workspace-manager-private.h"
#include "core/workspace-private.h"
#include "meta/prefs.h"

/* A simple macro for whether a given window's edges are potentially
* relevant for resistance/snapping during a move/resize operation
Expand Down Expand Up @@ -341,7 +342,8 @@ apply_edge_resistance (MetaWindow *window,
gboolean increasing = new_pos > old_pos;
int increment = increasing ? 1 : -1;

const int PIXEL_DISTANCE_THRESHOLD_TOWARDS_WINDOW = 16;
const gboolean resist = meta_prefs_get_edge_resistance_window ();
const int PIXEL_DISTANCE_THRESHOLD_TOWARDS_WINDOW = resist ? 16 : 0;
const int PIXEL_DISTANCE_THRESHOLD_AWAYFROM_WINDOW = 0;
const int PIXEL_DISTANCE_THRESHOLD_TOWARDS_MONITOR = 32;
const int PIXEL_DISTANCE_THRESHOLD_AWAYFROM_MONITOR = 0;
Expand Down
17 changes: 17 additions & 0 deletions src/core/prefs.c
Original file line number Diff line number Diff line change
Expand Up @@ -123,6 +123,7 @@ static int draggable_border_width = 10;
static int drag_threshold;
static gboolean resize_with_right_button = FALSE;
static gboolean edge_tiling = FALSE;
static gboolean edge_resistance_window = TRUE;
static gboolean force_fullscreen = TRUE;
static gboolean auto_maximize = TRUE;
static gboolean show_fallback_app_menu = TRUE;
Expand Down Expand Up @@ -415,6 +416,13 @@ static MetaBoolPreference preferences_bool[] =
},
&edge_tiling,
},
{
{ "edge-resistance-window",
SCHEMA_MUFFIN,
META_PREF_EDGE_RESISTANCE_WINDOW,
},
&edge_resistance_window,
},
{
{ "workspaces-only-on-primary",
SCHEMA_MUFFIN,
Expand Down Expand Up @@ -1925,6 +1933,9 @@ meta_preference_to_string (MetaPreference pref)
case META_PREF_EDGE_TILING:
return "EDGE_TILING";

case META_PREF_EDGE_RESISTANCE_WINDOW:
return "EDGE_RESISTANCE_WINDOW";

case META_PREF_FORCE_FULLSCREEN:
return "FORCE_FULLSCREEN";

Expand Down Expand Up @@ -2400,6 +2411,12 @@ meta_prefs_get_edge_tiling (void)
return edge_tiling;
}

gboolean
meta_prefs_get_edge_resistance_window (void)
{
return edge_resistance_window;
}

gboolean
meta_prefs_get_tile_maximize (void)
{
Expand Down
4 changes: 4 additions & 0 deletions src/meta/prefs.h
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,7 @@ typedef enum
META_PREF_CURSOR_SIZE,
META_PREF_RESIZE_WITH_RIGHT_BUTTON,
META_PREF_EDGE_TILING,
META_PREF_EDGE_RESISTANCE_WINDOW,
META_PREF_FORCE_FULLSCREEN,
META_PREF_WORKSPACES_ONLY_ON_PRIMARY,
META_PREF_DRAGGABLE_BORDER_WIDTH,
Expand Down Expand Up @@ -204,6 +205,9 @@ gboolean meta_prefs_get_gnome_animations (void);
META_EXPORT
gboolean meta_prefs_get_edge_tiling (void);

META_EXPORT
gboolean meta_prefs_get_edge_resistance_window (void);

META_EXPORT
gboolean meta_prefs_get_tile_maximize (void);

Expand Down