mirror of
https://github.com/gryf/wmaker.git
synced 2025-12-19 04:20:27 +01:00
wmaker: Add option for window snap to top edge to maximize to full screen.
This is a common behavior in a number of other environments, e.g., Unity and Windows.
This commit is contained in:
committed by
Carlos R. Mafra
parent
42e4069541
commit
9de5a27dbc
15
NEWS
15
NEWS
@@ -1,7 +1,20 @@
|
|||||||
|
|
||||||
NEWS for veteran Window Maker users
|
NEWS for veteran Window Maker users
|
||||||
-----------------------------------
|
-----------------------------------
|
||||||
|
|
||||||
|
-- 0.95.8
|
||||||
|
|
||||||
|
|
||||||
|
Snapping a window to the top
|
||||||
|
----------------------------
|
||||||
|
|
||||||
|
You can now choose whether snapping a window to the top edge of the screen
|
||||||
|
maximizes it to the top half (the previous and default behavior) or to the
|
||||||
|
full screen by setting "SnapToTopMaximizesFullscreen" to "NO" or "YES",
|
||||||
|
respectively. This setting can also be changed by unchecking or checking
|
||||||
|
"Snapping a window to the top maximizes it to the full screen" in the
|
||||||
|
"Expert User Preferences" tab in WPrefs.app.
|
||||||
|
|
||||||
|
|
||||||
-- 0.95.7
|
-- 0.95.7
|
||||||
|
|
||||||
Window snapping
|
Window snapping
|
||||||
|
|||||||
@@ -97,6 +97,9 @@ static const struct {
|
|||||||
{ N_("Distance from corner to begin window snap."),
|
{ N_("Distance from corner to begin window snap."),
|
||||||
/* default: */ 10, OPTION_WMAKER_INT, "SnapCornerDetect" },
|
/* default: */ 10, OPTION_WMAKER_INT, "SnapCornerDetect" },
|
||||||
|
|
||||||
|
{ N_("Snapping a window to the top maximizes it to the full screen."),
|
||||||
|
/* default: */ False, OPTION_WMAKER, "SnapToTopMaximizesFullscreen" },
|
||||||
|
|
||||||
{ N_("Open dialogs in the same workspace as their owners."),
|
{ N_("Open dialogs in the same workspace as their owners."),
|
||||||
/* default: */ False, OPTION_WMAKER, "OpenTransientOnOwnerWorkspace" }
|
/* default: */ False, OPTION_WMAKER, "OpenTransientOnOwnerWorkspace" }
|
||||||
|
|
||||||
|
|||||||
@@ -362,6 +362,7 @@ extern struct WPreferences {
|
|||||||
char window_snapping; /* enable window snapping */
|
char window_snapping; /* enable window snapping */
|
||||||
int snap_edge_detect; /* how far from edge to begin snap */
|
int snap_edge_detect; /* how far from edge to begin snap */
|
||||||
int snap_corner_detect; /* how far from corner to begin snap */
|
int snap_corner_detect; /* how far from corner to begin snap */
|
||||||
|
char snap_to_top_maximizes_fullscreen;
|
||||||
char drag_maximized_window; /* behavior when a maximized window is dragged */
|
char drag_maximized_window; /* behavior when a maximized window is dragged */
|
||||||
|
|
||||||
char highlight_active_app; /* show the focused app by highlighting its icon */
|
char highlight_active_app; /* show the focused app by highlighting its icon */
|
||||||
|
|||||||
@@ -478,6 +478,8 @@ WDefaultEntry optionList[] = {
|
|||||||
&wPreferences.snap_edge_detect, getInt, NULL, NULL, NULL},
|
&wPreferences.snap_edge_detect, getInt, NULL, NULL, NULL},
|
||||||
{"SnapCornerDetect", "10", NULL,
|
{"SnapCornerDetect", "10", NULL,
|
||||||
&wPreferences.snap_corner_detect, getInt, NULL, NULL, NULL},
|
&wPreferences.snap_corner_detect, getInt, NULL, NULL, NULL},
|
||||||
|
{"SnapToTopMaximizesFullscreen", "NO", NULL,
|
||||||
|
&wPreferences.snap_to_top_maximizes_fullscreen, getBool, NULL, NULL, NULL},
|
||||||
{"DragMaximizedWindow", "Move", seDragMaximizedWindow,
|
{"DragMaximizedWindow", "Move", seDragMaximizedWindow,
|
||||||
&wPreferences.drag_maximized_window, getEnum, NULL, NULL, NULL},
|
&wPreferences.drag_maximized_window, getEnum, NULL, NULL, NULL},
|
||||||
{"HighlightActiveApp", "YES", NULL,
|
{"HighlightActiveApp", "YES", NULL,
|
||||||
|
|||||||
@@ -1212,6 +1212,9 @@ static void draw_snap_frame(WWindow *wwin, int direction)
|
|||||||
break;
|
break;
|
||||||
|
|
||||||
case SNAP_TOP:
|
case SNAP_TOP:
|
||||||
|
if (wPreferences.snap_to_top_maximizes_fullscreen)
|
||||||
|
drawTransparentFrame(wwin, 0, 0, scr->scr_width, scr->scr_height);
|
||||||
|
else
|
||||||
drawTransparentFrame(wwin, 0, 0, scr->scr_width, scr->scr_height/2);
|
drawTransparentFrame(wwin, 0, 0, scr->scr_width, scr->scr_height/2);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
@@ -1289,6 +1292,9 @@ static void do_snap(WWindow *wwin, MoveData *data, Bool opaqueMove)
|
|||||||
directions = MAX_VERTICAL | MAX_RIGHTHALF;
|
directions = MAX_VERTICAL | MAX_RIGHTHALF;
|
||||||
break;
|
break;
|
||||||
case SNAP_TOP:
|
case SNAP_TOP:
|
||||||
|
if (wPreferences.snap_to_top_maximizes_fullscreen)
|
||||||
|
directions = MAX_HORIZONTAL | MAX_VERTICAL;
|
||||||
|
else
|
||||||
directions = MAX_HORIZONTAL | MAX_TOPHALF;
|
directions = MAX_HORIZONTAL | MAX_TOPHALF;
|
||||||
break;
|
break;
|
||||||
case SNAP_BOTTOM:
|
case SNAP_BOTTOM:
|
||||||
|
|||||||
Reference in New Issue
Block a user