Skip to content

Commit

Permalink
Maximize: add 'fullscreen' option
Browse files Browse the repository at this point in the history
Not all EWMH-aware applications make it obvious that they can be
fullscreened.  Let FVWM put windows into this state by adding a
'fullscreen' option to the 'Maximize' command.
  • Loading branch information
ThomasAdam committed May 30, 2018
1 parent 818c0a9 commit 9a313bb
Show file tree
Hide file tree
Showing 3 changed files with 36 additions and 8 deletions.
1 change: 1 addition & 0 deletions NEWS
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ Changes in stable release 2.6.8 (UNRELEASED)

- fvwm-menu-desktop(1) now requires python3 as an explicit
dependency.
- Add a 'fullscreen' option to the 'Maximize' command.

-------------------------------------------------------------------
Changes in stable release 2.6.7 (06-Mar-2016)
Expand Down
4 changes: 3 additions & 1 deletion doc/commands/Maximize.xml
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,9 @@ The optional
<replaceable>flags</replaceable>
argument is a space separated list containing the following
key words:
<emphasis remap='I'>ewmhiwa</emphasis>, <emphasis remap='I'>growonwindowlayer</emphasis>, <emphasis remap='I'>growonlayers</emphasis> and <emphasis remap='I'>screen</emphasis>.
<emphasis remap='I'>fullscreen</emphasis>, <emphasis remap='I'>ewmhiwa</emphasis>, <emphasis remap='I'>growonwindowlayer</emphasis>, <emphasis remap='I'>growonlayers</emphasis> and <emphasis remap='I'>screen</emphasis>.
<fvwmopt cmd="Maximize" opt="fullscreen"/>
causes the window to become fullscreened if the appropriate EWMH hint is set.
<fvwmopt cmd="Maximize" opt="ewmhiwa"/>
causes fvwm to ignore the <acronym>EWMH</acronym> working area.
<fvwmopt cmd="Maximize" opt="growonwindowlayer"/>
Expand Down
39 changes: 32 additions & 7 deletions fvwm/move_resize.c
Original file line number Diff line number Diff line change
Expand Up @@ -4725,6 +4725,7 @@ void CMD_Maximize(F_CMD_ARGS)
Bool do_forget = False;
Bool is_screen_given = False;
Bool ignore_working_area = False;
Bool do_fullscreen = False;
int layers[2] = { -1, -1 };
Bool global_flag_parsed = False;
int scr_x, scr_y;
Expand Down Expand Up @@ -4784,22 +4785,46 @@ void CMD_Maximize(F_CMD_ARGS)
layers[1] = -1;
}
}
else if (StrEquals(token, "fullscreen"))
{
do_fullscreen = True;
action = taction;
}
else
{
global_flag_parsed = True;
}
}
}
toggle = ParseToggleArgument(action, &action, -1, 0);
if (toggle == 0 && !IS_MAXIMIZED(fw))
{
if (do_fullscreen) {
if (toggle == -1) {
/* Flip-flop between fullscreen or not, if no toggle
* argument is given.
*/
toggle = (IS_EWMH_FULLSCREEN(fw) ? 0 : 1);
}
if (toggle == 1 && !IS_EWMH_FULLSCREEN(fw)) {
EWMH_fullscreen(fw);
return;
}

if (toggle == 0 && IS_EWMH_FULLSCREEN(fw)) {
unmaximize_fvwm_window(fw);
return;
}
return;
}
} else {
if (toggle == 0 && !IS_MAXIMIZED(fw))
{
return;
}

if (toggle == 1 && IS_MAXIMIZED(fw))
{
/* Fake that the window is not maximized. */
do_force_maximize = True;
if (toggle == 1 && IS_MAXIMIZED(fw))
{
/* Fake that the window is not maximized. */
do_force_maximize = True;
}
}

/* find the new page and geometry */
Expand Down

0 comments on commit 9a313bb

Please sign in to comment.