1
0
mirror of https://github.com/gryf/wmaker.git synced 2026-03-26 15:03:34 +01:00

4 Commits

Author SHA1 Message Date
Carlos R. Mafra
d0aa2cefcd Window Maker 0.96.0 2023-08-05 08:46:23 +01:00
David Maciejak
a52d13c8b8 Fix autoconf obsolete macros
autogen.sh is reporting some warnings as below

./autogen.sh 2>&1 |grep "obsolete"
libtoolize: copying file 'm4/lt~obsolete.m4'
configure.ac:115: warning: The macro `AC_LANG_C' is obsolete.
configure.ac:115: warning: The macro `AC_TRY_COMPILE' is obsolete.
configure.ac:134: warning: The macro `AC_LANG_C' is obsolete.
configure.ac:134: warning: The macro `AC_TRY_COMPILE' is obsolete.
configure.ac:135: warning: The macro `AC_LANG_C' is obsolete.
configure.ac:135: warning: The macro `AC_TRY_COMPILE' is obsolete.
configure.ac:146: warning: The macro `AC_LANG_C' is obsolete.
configure.ac:146: warning: The macro `AC_TRY_COMPILE' is obsolete.
configure.ac:146: warning: The macro `AC_LANG_C' is obsolete.
configure.ac:146: warning: The macro `AC_TRY_COMPILE' is obsolete.
configure.ac:373: warning: The macro `AC_LANG_C' is obsolete.
configure.ac:373: warning: The macro `AC_TRY_COMPILE' is obsolete.
configure.ac:458: warning: The macro `AC_HEADER_TIME' is obsolete.
configure.ac:681: warning: The macro `AC_TRY_LINK' is obsolete.
configure.ac:807: warning: The macro `AC_TRY_LINK' is obsolete.

As the minimum autoconf version required is v2.69,
we need to make sure to update obsolete macros as described at
https://www.gnu.org/software/autoconf/manual/autoconf-2.69/html_node/Obsolete-Macros.html
2023-04-14 23:45:00 +01:00
David Maciejak
215b6ee2e6 Set proper motif wm hints name
Just a cosmetic change as the variable is currently not in use.
According to the Motif Toolkit API and MwmUtil.h, the last long
variable from the Motif WM Hints struct is currenlty used
for the status.
2023-04-09 10:42:52 +01:00
David Maciejak
ab45c6c6c2 Add central position feature for active window
This patch adds a new Central feature under the window menu
"Other maximization" entry.
Shortcut can be configured via WPrefs "Center active window" action.
When called the active window is centered on the screen head.
If the window height or width are bigger than the head size,
the window is resized to fit.
There are some transitions defined as below:
*from fullscreen to center
*from any corner to center
*from top half to center top half
*from bottom half to center bottom half
*from left half to center left half
*from right half to center right half

Undoing the action is done via the window menu "Unmaximize" entry
or the shortcut.
2023-03-31 09:11:38 +01:00
20 changed files with 110 additions and 41 deletions

View File

@@ -89,6 +89,7 @@ static struct keyOption {
{ "BLCMaximizeKey", N_("Maximize active window bottom left corner") },
{ "BRCMaximizeKey", N_("Maximize active window bottom right corner") },
{ "MaximusKey", N_("Tile active window") },
{ "CenterKey", N_("Center active window") },
{ "KeepOnTopKey", N_("Toggle window on top status") },
{ "KeepAtBottomKey",N_("Toggle window at bottom status") },
{ "OmnipresentKey", N_("Toggle window omnipresent status") },

View File

@@ -34,7 +34,7 @@ AC_PREREQ([2.69])
dnl Configuration for Autoconf and Automake
dnl =======================================
AC_INIT([WindowMaker],[0.95.9],[wmaker-dev@googlegroups.com],[WindowMaker],[http://www.windowmaker.org/])
AC_INIT([WindowMaker],[0.96.0],[wmaker-dev@googlegroups.com],[WindowMaker],[http://www.windowmaker.org/])
AC_CONFIG_MACRO_DIR([m4])
AC_CONFIG_HEADERS([config.h])
@@ -455,7 +455,6 @@ AC_CHECK_HEADERS([syslog.h], [AC_DEFINE([HAVE_SYSLOG], [1], [Check for syslog])]
dnl Checks for header files
dnl =======================
AC_HEADER_SYS_WAIT
AC_HEADER_TIME
AC_CHECK_HEADERS(fcntl.h limits.h sys/ioctl.h libintl.h poll.h malloc.h ctype.h \
string.h strings.h)

View File

@@ -80,14 +80,14 @@ AS_VAR_PUSHDEF([VAR],[ax_cv_cflags_gcc_option_$2])dnl
AC_CACHE_CHECK([m4_ifval($1,$1,FLAGS) for gcc m4_ifval($2,$2,-option)],
VAR,[VAR="no, unknown"
AC_LANG_SAVE
AC_LANG_C
AC_LANG(C)
ac_save_[]FLAGS="$[]FLAGS"
for ac_arg dnl
in "-pedantic -Werror % m4_ifval($2,$2,-option)" dnl GCC
"-pedantic % m4_ifval($2,$2,-option) %% no, obsolete" dnl new GCC
#
do FLAGS="$ac_save_[]FLAGS "`echo $ac_arg | sed -e 's,%%.*,,' -e 's,%,,'`
AC_TRY_COMPILE([],[return 0;],
AC_COMPILE_IFELSE([AC_LANG_PROGRAM([],[return 0;])],
[VAR=`echo $ac_arg | sed -e 's,.*% *,,'` ; break])
done
FLAGS="$ac_save_[]FLAGS"
@@ -116,14 +116,14 @@ AS_VAR_PUSHDEF([VAR],[ax_cv_cxxflags_gcc_option_$2])dnl
AC_CACHE_CHECK([m4_ifval($1,$1,FLAGS) for gcc m4_ifval($2,$2,-option)],
VAR,[VAR="no, unknown"
AC_LANG_SAVE
AC_LANG_CPLUSPLUS
AC_LANG(C++)
ac_save_[]FLAGS="$[]FLAGS"
for ac_arg dnl
in "-pedantic -Werror % m4_ifval($2,$2,-option)" dnl GCC
"-pedantic % m4_ifval($2,$2,-option) %% no, obsolete" dnl new GCC
#
do FLAGS="$ac_save_[]FLAGS "`echo $ac_arg | sed -e 's,%%.*,,' -e 's,%,,'`
AC_TRY_COMPILE([],[return 0;],
AC_COMPILE_IFELSE([AC_LANG_PROGRAM([],[return 0;])],
[VAR=`echo $ac_arg | sed -e 's,.*% *,,'` ; break])
done
FLAGS="$ac_save_[]FLAGS"
@@ -151,14 +151,14 @@ AS_VAR_PUSHDEF([VAR],[ax_cv_cflags_gcc_option_$1])dnl
AC_CACHE_CHECK([m4_ifval($2,$2,FLAGS) for gcc m4_ifval($1,$1,-option)],
VAR,[VAR="no, unknown"
AC_LANG_SAVE
AC_LANG_C
AC_LANG(C)
ac_save_[]FLAGS="$[]FLAGS"
for ac_arg dnl
in "-pedantic -Werror % m4_ifval($1,$1,-option)" dnl GCC
"-pedantic % m4_ifval($1,$1,-option) %% no, obsolete" dnl new GCC
#
do FLAGS="$ac_save_[]FLAGS "`echo $ac_arg | sed -e 's,%%.*,,' -e 's,%,,'`
AC_TRY_COMPILE([],[return 0;],
AC_COMPILE_IFELSE([AC_LANG_PROGRAM([],[return 0;])],
[VAR=`echo $ac_arg | sed -e 's,.*% *,,'` ; break])
done
FLAGS="$ac_save_[]FLAGS"
@@ -187,14 +187,14 @@ AS_VAR_PUSHDEF([VAR],[ax_cv_cxxflags_gcc_option_$1])dnl
AC_CACHE_CHECK([m4_ifval($2,$2,FLAGS) for gcc m4_ifval($1,$1,-option)],
VAR,[VAR="no, unknown"
AC_LANG_SAVE
AC_LANG_CPLUSPLUS
AC_LANG(C++)
ac_save_[]FLAGS="$[]FLAGS"
for ac_arg dnl
in "-pedantic -Werror % m4_ifval($1,$1,-option)" dnl GCC
"-pedantic % m4_ifval($1,$1,-option) %% no, obsolete" dnl new GCC
#
do FLAGS="$ac_save_[]FLAGS "`echo $ac_arg | sed -e 's,%%.*,,' -e 's,%,,'`
AC_TRY_COMPILE([],[return 0;],
AC_COMPILE_IFELSE([AC_LANG_PROGRAM([],[return 0;])],
[VAR=`echo $ac_arg | sed -e 's,.*% *,,'` ; break])
done
FLAGS="$ac_save_[]FLAGS"

View File

@@ -47,14 +47,15 @@ AC_DEFUN([WM_CHECK_XFT_VERSION],
AC_CACHE_CHECK([whether libXft is at least version $1], [ac_cv_lib_xft_version_ok],
[CPPFLAGS_save="$CPPFLAGS"
CPPFLAGS="$CPPFLAGS $XFT_CFLAGS $inc_search_path"
AC_TRY_LINK([
AC_LINK_IFELSE(
[AC_LANG_PROGRAM([
#include <X11/Xlib.h>
#include <X11/Xft/Xft.h>
], [
#if !defined(XFT_VERSION) || XFT_VERSION < ]XFT_REQUIRED_VERSION[
#error libXft on this system is too old. Consider upgrading to at least $1
#endif
], [ac_cv_lib_xft_version_ok=yes], [ac_cv_lib_xft_version_ok=no])
])], [ac_cv_lib_xft_version_ok=yes], [ac_cv_lib_xft_version_ok=no])
CPPFLAGS="$CPPFLAGS_save"])
m4_undefine([XFT_REQUIRED_VERSION])dnl
AS_IF([test "x$ac_cv_lib_xft_version_ok" != "xyes"], [$3], [$2])dnl

View File

@@ -198,9 +198,9 @@ AC_DEFUN_ONCE([WM_IMGFMT_CHECK_WEBP],
dnl a symbol without first using the header to handle it
wm_save_LIBS="$LIBS"
LIBS="$LIBS -lwebp"
AC_TRY_LINK(
[@%:@include <webp/decode.h>],
[WebPGetFeatures(NULL, 1024, NULL);],
AC_LINK_IFELSE(
[AC_LANG_PROGRAM([@%:@include <webp/decode.h>],
[WebPGetFeatures(NULL, 1024, NULL);])],
[wm_cv_imgfmt_webp="-lwebp"])
LIBS="$wm_save_LIBS"
AS_IF([test "x$enable_webp$wm_cv_imgfmt_webp" = "xyesno"],

View File

@@ -404,7 +404,7 @@ void wMaximizeWindow(WWindow *wwin, int directions, int head)
usableArea = wGetUsableAreaForHead(scr, head, &totalArea, True);
/* Only save directions, not kbd or xinerama hints */
directions &= (MAX_HORIZONTAL | MAX_VERTICAL | MAX_LEFTHALF | MAX_RIGHTHALF | MAX_TOPHALF | MAX_BOTTOMHALF | MAX_MAXIMUS);
directions &= (MAX_HORIZONTAL | MAX_VERTICAL | MAX_LEFTHALF | MAX_RIGHTHALF | MAX_TOPHALF | MAX_BOTTOMHALF | MAX_MAXIMUS | MAX_CENTRAL);
if (WFLAGP(wwin, full_maximize))
usableArea = totalArea;
@@ -431,12 +431,31 @@ void wMaximizeWindow(WWindow *wwin, int directions, int head)
wwin->maximus_y = new_y;
wwin->flags.old_maximized |= MAX_MAXIMUS;
} else {
/* center the window if can fit, if not sticking it to the screen edges */
if (directions & MAX_CENTRAL) {
if (wwin->frame->core->height > (usableArea.y2 - usableArea.y1)) {
new_y = usableArea.y1;
new_height = usableArea.y2 - usableArea.y1 - adj_size;
} else {
new_height = (wwin->old_geometry.height) ? wwin->old_geometry.height : wwin->frame->core->height;
new_height += wwin->frame->top_width + wwin->frame->bottom_width;
new_y = half_scr_height - new_height / 2;
}
if (wwin->frame->core->width > (usableArea.x2 - usableArea.x1)) {
new_x = usableArea.x1;
new_width = usableArea.x2 - usableArea.x1 - adj_size;
}
else {
new_width = (wwin->old_geometry.width) ? wwin->old_geometry.width : wwin->frame->core->width;
new_x = half_scr_width - new_width / 2;
}
}
/* set default values if no option set then */
if (!(directions & (MAX_HORIZONTAL | MAX_LEFTHALF | MAX_RIGHTHALF | MAX_MAXIMUS))) {
if (!(directions & (MAX_HORIZONTAL | MAX_LEFTHALF | MAX_RIGHTHALF | MAX_MAXIMUS | MAX_CENTRAL))) {
new_width = (wwin->old_geometry.width) ? wwin->old_geometry.width : wwin->frame->core->width;
new_x = (wwin->old_geometry.x) ? wwin->old_geometry.x : wwin->frame_x;
}
if (!(directions & (MAX_VERTICAL | MAX_TOPHALF | MAX_BOTTOMHALF | MAX_MAXIMUS))) {
if (!(directions & (MAX_VERTICAL | MAX_TOPHALF | MAX_BOTTOMHALF | MAX_MAXIMUS| MAX_CENTRAL))) {
new_height = (wwin->old_geometry.height) ? wwin->old_geometry.height : wwin->frame->core->height;
new_y = (wwin->old_geometry.y) ? wwin->old_geometry.y : wwin->frame_y;
}
@@ -445,17 +464,26 @@ void wMaximizeWindow(WWindow *wwin, int directions, int head)
if (directions & MAX_LEFTHALF) {
new_width = half_scr_width - adj_size;
new_x = usableArea.x1;
if (directions & MAX_CENTRAL) {
new_y = half_scr_height - wwin->old_geometry.height / 2;
}
} else if (directions & MAX_RIGHTHALF) {
new_width = half_scr_width - adj_size;
new_x = usableArea.x1 + half_scr_width;
if (directions & MAX_CENTRAL)
new_y = half_scr_height - wwin->old_geometry.height / 2;
}
/* top|bottom position */
if (directions & MAX_TOPHALF) {
new_height = half_scr_height - adj_size;
new_y = usableArea.y1;
if (directions & MAX_CENTRAL)
new_x = half_scr_width - wwin->old_geometry.width / 2;
} else if (directions & MAX_BOTTOMHALF) {
new_height = half_scr_height - adj_size;
new_y = usableArea.y1 + half_scr_height;
if (directions & MAX_CENTRAL)
new_x = half_scr_width - wwin->old_geometry.width / 2;
}
/* vertical|horizontal position */
@@ -494,7 +522,7 @@ void wMaximizeWindow(WWindow *wwin, int directions, int head)
void handleMaximize(WWindow *wwin, int directions)
{
int current = wwin->flags.maximized;
int requested = directions & (MAX_HORIZONTAL | MAX_VERTICAL | MAX_LEFTHALF | MAX_RIGHTHALF | MAX_TOPHALF | MAX_BOTTOMHALF | MAX_MAXIMUS);
int requested = directions & (MAX_HORIZONTAL | MAX_VERTICAL | MAX_LEFTHALF | MAX_RIGHTHALF | MAX_TOPHALF | MAX_BOTTOMHALF | MAX_MAXIMUS | MAX_CENTRAL);
int effective = requested ^ current;
int flags = directions & ~requested;
int head = wGetHeadForWindow(wwin);
@@ -625,11 +653,24 @@ void handleMaximize(WWindow *wwin, int directions)
head);
else {
if ((requested == (MAX_HORIZONTAL | MAX_VERTICAL)) ||
(requested == MAX_MAXIMUS))
effective = requested;
else {
if (requested & MAX_LEFTHALF) {
if (requested & MAX_CENTRAL) {
effective |= MAX_CENTRAL;
if (current & (MAX_HORIZONTAL | MAX_VERTICAL))
effective &= ~(MAX_HORIZONTAL | MAX_VERTICAL);
else if (current & MAX_TOPHALF && current & MAX_LEFTHALF)
effective &= ~(MAX_TOPHALF | MAX_LEFTHALF);
else if (current & MAX_TOPHALF && current & MAX_RIGHTHALF)
effective &= ~(MAX_TOPHALF | MAX_RIGHTHALF);
else if (current & MAX_BOTTOMHALF && current & MAX_LEFTHALF)
effective &= ~(MAX_BOTTOMHALF | MAX_LEFTHALF);
else if (current & MAX_BOTTOMHALF && current & MAX_RIGHTHALF)
effective &= ~(MAX_BOTTOMHALF | MAX_RIGHTHALF);
} else if (requested & MAX_LEFTHALF) {
if (!(requested & (MAX_TOPHALF | MAX_BOTTOMHALF)))
effective |= MAX_VERTICAL;
else

View File

@@ -30,8 +30,9 @@
#define MAX_TOPHALF (1 << 4)
#define MAX_BOTTOMHALF (1 << 5)
#define MAX_MAXIMUS (1 << 6)
#define MAX_IGNORE_XINERAMA (1 << 7)
#define MAX_KEYBOARD (1 << 8)
#define MAX_CENTRAL (1 << 7)
#define MAX_IGNORE_XINERAMA (1 << 8)
#define MAX_KEYBOARD (1 << 9)
#define SAVE_GEOMETRY_X (1 << 0)
#define SAVE_GEOMETRY_Y (1 << 1)

View File

@@ -240,9 +240,9 @@ void wClientConfigure(WWindow * wwin, XConfigureRequestEvent * xcre)
return;
if (nwidth != wwin->old_geometry.width)
wwin->flags.maximized &= ~(MAX_HORIZONTAL | MAX_TOPHALF | MAX_BOTTOMHALF | MAX_MAXIMUS);
wwin->flags.maximized &= ~(MAX_HORIZONTAL | MAX_TOPHALF | MAX_BOTTOMHALF | MAX_MAXIMUS | MAX_CENTRAL);
if (nheight != wwin->old_geometry.height)
wwin->flags.maximized &= ~(MAX_VERTICAL | MAX_LEFTHALF | MAX_RIGHTHALF | MAX_MAXIMUS);
wwin->flags.maximized &= ~(MAX_VERTICAL | MAX_LEFTHALF | MAX_RIGHTHALF | MAX_MAXIMUS | MAX_CENTRAL);
wWindowConstrainSize(wwin, (unsigned int *)&nwidth, (unsigned int *)&nheight);
wWindowConfigure(wwin, nx, ny, nwidth, nheight);

View File

@@ -36,6 +36,10 @@ static unsigned char MENU_SNAP_H_INDICATOR_XBM_DATA[] = {
0xff, 0x03, 0x01, 0x02, 0xff, 0x03, 0xff, 0x03, 0xff, 0x03, 0x01, 0x02,
0x01, 0x02, 0x01, 0x02, 0xff, 0x03 };
static unsigned char MENU_CENTRAL_INDICATOR_XBM_DATA[] = {
0xff, 0x03, 0x01, 0x02, 0x79, 0x02, 0x79, 0x02, 0x79, 0x02, 0x79, 0x02,
0x79, 0x02, 0x01, 0x02, 0xff, 0x03 };
static unsigned char MENU_SNAP_RH_INDICATOR_XBM_DATA[] = {
0xff, 0x03, 0x01, 0x02, 0xe1, 0x02, 0xe1, 0x02, 0xe1, 0x02, 0xe1, 0x02,
0xe1, 0x02, 0x01, 0x02, 0xff, 0x03 };

View File

@@ -681,6 +681,8 @@ WDefaultEntry optionList[] = {
NULL, getKeybind, setKeyGrab, NULL, NULL},
{"MaximusKey", "None", (void*)WKBD_MAXIMUS,
NULL, getKeybind, setKeyGrab, NULL, NULL},
{"CenterKey", "None", (void *)WKBD_CENTRAL,
NULL, getKeybind, setKeyGrab, NULL, NULL},
{"KeepOnTopKey", "None", (void *)WKBD_KEEP_ON_TOP,
NULL, getKeybind, setKeyGrab, NULL, NULL},
{"KeepAtBottomKey", "None", (void *)WKBD_KEEP_AT_BOTTOM,

View File

@@ -1515,6 +1515,14 @@ static void handleKeyPress(XEvent * event)
movePointerToWindowCenter(wwin);
}
break;
case WKBD_CENTRAL:
if (ISMAPPED(wwin) && ISFOCUSED(wwin) && IS_RESIZABLE(wwin)) {
CloseWindowMenu(scr);
handleMaximize(wwin, MAX_CENTRAL | MAX_KEYBOARD);
movePointerToWindowCenter(wwin);
}
break;
case WKBD_LHMAXIMIZE:
if (ISMAPPED(wwin) && ISFOCUSED(wwin) && IS_RESIZABLE(wwin)) {
CloseWindowMenu(scr);

View File

@@ -76,6 +76,7 @@ enum {
WKBD_FOCUSPREV,
WKBD_GROUPNEXT,
WKBD_GROUPPREV,
WKBD_CENTRAL,
/* window, menu */
WKBD_CLOSE,

View File

@@ -743,10 +743,13 @@ static void paintEntry(WMenu * menu, int index, int selected)
indicator = scr->menu_shade_indicator;
break;
case MI_SNAP_V:
indicator = scr->menu_snap_vertically_indicator;
indicator = scr->menu_snap_vertical_indicator;
break;
case MI_SNAP_H:
indicator = scr->menu_snap_horizontally_indicator;
indicator = scr->menu_snap_horizontal_indicator;
break;
case MI_CENTRAL:
indicator = scr->menu_central_indicator;
break;
case MI_SNAP_RH:
indicator = scr->menu_snap_rh_indicator;

View File

@@ -40,6 +40,7 @@
#define MI_SNAP_BL 14
#define MI_SNAP_BR 15
#define MI_SNAP_TILED 16
#define MI_CENTRAL 17
typedef struct WMenuEntry {
int order;

View File

@@ -62,7 +62,7 @@ typedef struct {
long functions;
long decorations;
long inputMode;
long unknown;
long status;
} MWMHints;
static Atom _XA_MOTIF_WM_HINTS;
@@ -180,7 +180,7 @@ static int getMWMHints(Window window, MWMHints *mwmhints)
mwmhints->decorations = data[2];
mwmhints->inputMode = data[3];
if (count > 5)
mwmhints->unknown = data[4];
mwmhints->status = data[4];
}
XFree(data);

View File

@@ -1665,10 +1665,10 @@ int wKeyboardMoveResizeWindow(WWindow * wwin)
}
} else {
if (ww != original_w)
wwin->flags.maximized &= ~(MAX_HORIZONTAL | MAX_TOPHALF | MAX_BOTTOMHALF | MAX_MAXIMUS);
wwin->flags.maximized &= ~(MAX_HORIZONTAL | MAX_TOPHALF | MAX_BOTTOMHALF | MAX_MAXIMUS | MAX_CENTRAL);
if (wh != original_h)
wwin->flags.maximized &= ~(MAX_VERTICAL | MAX_LEFTHALF | MAX_RIGHTHALF | MAX_MAXIMUS);
wwin->flags.maximized &= ~(MAX_VERTICAL | MAX_LEFTHALF | MAX_RIGHTHALF | MAX_MAXIMUS | MAX_CENTRAL);
wWindowConfigure(wwin, src_x + off_x, src_y + off_y, ww, wh - vert_border);
wWindowSynthConfigureNotify(wwin);
@@ -2283,10 +2283,10 @@ void wMouseResizeWindow(WWindow * wwin, XEvent * ev)
XUngrabServer(dpy);
if (fw != original_fw)
wwin->flags.maximized &= ~(MAX_HORIZONTAL | MAX_TOPHALF | MAX_BOTTOMHALF | MAX_MAXIMUS);
wwin->flags.maximized &= ~(MAX_HORIZONTAL | MAX_TOPHALF | MAX_BOTTOMHALF | MAX_MAXIMUS | MAX_CENTRAL);
if (fh != original_fh)
wwin->flags.maximized &= ~(MAX_VERTICAL | MAX_LEFTHALF | MAX_RIGHTHALF | MAX_MAXIMUS);
wwin->flags.maximized &= ~(MAX_VERTICAL | MAX_LEFTHALF | MAX_RIGHTHALF | MAX_MAXIMUS | MAX_CENTRAL);
wWindowConfigure(wwin, fx, fy, fw, fh - vert_border);
wWindowSynthConfigureNotify(wwin);

View File

@@ -498,8 +498,9 @@ static void createPixmaps(WScreen * scr)
LOADPIXMAPINDICATOR(MENU_HIDE_INDICATOR_XBM_DATA, MENU_HIDE_INDICATOR_XBM_SIZE, menu_hide_indicator)
LOADPIXMAPINDICATOR(MENU_SHADE_INDICATOR_XBM_DATA, MENU_SHADE_INDICATOR_XBM_SIZE, menu_shade_indicator)
LOADPIXMAPINDICATOR(MENU_SNAP_V_INDICATOR_XBM_DATA, MENU_SNAP_INDICATOR_W_XBM_SIZE, menu_snap_vertically_indicator)
LOADPIXMAPINDICATOR(MENU_SNAP_H_INDICATOR_XBM_DATA, MENU_SNAP_INDICATOR_W_XBM_SIZE, menu_snap_horizontally_indicator)
LOADPIXMAPINDICATOR(MENU_SNAP_V_INDICATOR_XBM_DATA, MENU_SNAP_INDICATOR_W_XBM_SIZE, menu_snap_vertical_indicator)
LOADPIXMAPINDICATOR(MENU_SNAP_H_INDICATOR_XBM_DATA, MENU_SNAP_INDICATOR_W_XBM_SIZE, menu_snap_horizontal_indicator)
LOADPIXMAPINDICATOR(MENU_CENTRAL_INDICATOR_XBM_DATA, MENU_SNAP_INDICATOR_W_XBM_SIZE, menu_central_indicator)
LOADPIXMAPINDICATOR(MENU_SNAP_RH_INDICATOR_XBM_DATA, MENU_SNAP_INDICATOR_W_XBM_SIZE, menu_snap_rh_indicator)
LOADPIXMAPINDICATOR(MENU_SNAP_LH_INDICATOR_XBM_DATA, MENU_SNAP_INDICATOR_W_XBM_SIZE, menu_snap_lh_indicator)
LOADPIXMAPINDICATOR(MENU_SNAP_TH_INDICATOR_XBM_DATA, MENU_SNAP_INDICATOR_W_XBM_SIZE, menu_snap_th_indicator)

View File

@@ -214,8 +214,8 @@ typedef struct _WScreen {
struct WPixmap *menu_mini_indicator; /* for miniwindow */
struct WPixmap *menu_hide_indicator; /* for hidden window */
struct WPixmap *menu_shade_indicator; /* for shaded window */
struct WPixmap *menu_snap_vertically_indicator; /* for vertically snap window */
struct WPixmap *menu_snap_horizontally_indicator; /* for horizontally snap window */
struct WPixmap *menu_snap_vertical_indicator; /* for vertical snap window */
struct WPixmap *menu_snap_horizontal_indicator; /* for horizontal snap window */
struct WPixmap *menu_snap_rh_indicator; /* for righ half snap window */
struct WPixmap *menu_snap_lh_indicator; /* for left half snap window */
struct WPixmap *menu_snap_th_indicator; /* for top half snap window */
@@ -225,6 +225,7 @@ typedef struct _WScreen {
struct WPixmap *menu_snap_bl_indicator; /* for bottom left snap window */
struct WPixmap *menu_snap_br_indicator; /* for bottom right snap window */
struct WPixmap *menu_snap_tiled_indicator; /* for tiled window */
struct WPixmap *menu_central_indicator; /* for central window */
int app_menu_x, app_menu_y; /* position for application menus */

View File

@@ -251,8 +251,8 @@ typedef struct WWindow {
unsigned int miniaturized:1;
unsigned int hidden:1;
unsigned int shaded:1;
unsigned int maximized:7;
unsigned int old_maximized:7;
unsigned int maximized:10;
unsigned int old_maximized:10;
unsigned int fullscreen:1;
long fullscreen_monitors[4];
unsigned int omnipresent:1;

View File

@@ -124,8 +124,9 @@ static const struct {
unsigned int shortcut_idx;
int maxim_direction;
} menu_maximize_entries[] = {
{ MI_SNAP_V, N_("Vertically"), WKBD_VMAXIMIZE, MAX_VERTICAL },
{ MI_SNAP_H, N_("Horizontally"), WKBD_HMAXIMIZE, MAX_HORIZONTAL },
{ MI_SNAP_V, N_("Vertical"), WKBD_VMAXIMIZE, MAX_VERTICAL },
{ MI_SNAP_H, N_("Horizontal"), WKBD_HMAXIMIZE, MAX_HORIZONTAL },
{ MI_CENTRAL, N_("Central"), WKBD_CENTRAL, MAX_CENTRAL },
{ MI_SNAP_LH, N_("Left half"), WKBD_LHMAXIMIZE, MAX_VERTICAL | MAX_LEFTHALF },
{ MI_SNAP_RH, N_("Right half"), WKBD_RHMAXIMIZE, MAX_VERTICAL | MAX_RIGHTHALF },
{ MI_SNAP_TH, N_("Top half"), WKBD_THMAXIMIZE, MAX_HORIZONTAL | MAX_TOPHALF },
@@ -181,7 +182,7 @@ static void updateUnmaximizeShortcut(WMenuEntry * entry, int flags)
{
int key;
switch (flags & (MAX_HORIZONTAL | MAX_VERTICAL | MAX_LEFTHALF | MAX_RIGHTHALF | MAX_TOPHALF | MAX_BOTTOMHALF | MAX_MAXIMUS)) {
switch (flags & (MAX_HORIZONTAL | MAX_VERTICAL | MAX_LEFTHALF | MAX_RIGHTHALF | MAX_TOPHALF | MAX_BOTTOMHALF | MAX_MAXIMUS | MAX_CENTRAL)) {
case MAX_HORIZONTAL:
key = WKBD_HMAXIMIZE;
break;
@@ -190,6 +191,10 @@ static void updateUnmaximizeShortcut(WMenuEntry * entry, int flags)
key = WKBD_VMAXIMIZE;
break;
case MAX_CENTRAL:
key = WKBD_CENTRAL;
break;
case MAX_LEFTHALF | MAX_VERTICAL:
key = WKBD_LHMAXIMIZE;
break;