Skip to content

Commit

Permalink
window: sync up command line option and code behavior.
Browse files Browse the repository at this point in the history
The description for --no-force-fullscreen explicitly states that it
disables forcing fullscreen mode on windows that have *no* decorations
and are screen-sized.

Up until now, the code directly contradicted that by running the part
only if either the decorations where *enabled* or no CSD being used.

That causes multiple problems.

First, modern video players, which can certainly not be regarded as
"legacy applications", that try to show the video window as big as
possible and hence set the extents to exactly the screen size, including
using static gravity (so that borders are NOT removed from the window
size automatically) but still request window decorations are wrongly
forced into fullscreen mode by this hack. Changing the gravity would
work around that problem because the window size is effectively lowered,
but we can't expect applications to work around bugs in marco.

Secondly, the check for window decorations (or not) gets completely
cancelled out by the OR'd check for no CSD. According to the original
commit message, this hasn't been the intention, but rather to NOT force
fullscreen mode on windows that have no decorations and are CSD. It was
meant well, but the logic behind the change failed to do what it was
supposed to do.

Hence, fix that by checking if an application explicitly disabled window
decorations *AND* is not CSD.

This syncs up the help description and code behavior and fixes the CSD
part, but note that, naturally, it also changes the general behavior.
Specifically, this might break cases in which applications were supposed
to be forced into fullscreen mode even though they didn't explicitly
disable window decorations. I'd argue that such behavior would rather be
a bug and not a feature, though.
  • Loading branch information
Ionic committed Mar 7, 2020
1 parent ff9ed6d commit c070bfa
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/core/window.c
Original file line number Diff line number Diff line change
Expand Up @@ -4980,7 +4980,7 @@ meta_window_move_resize_request (MetaWindow *window,
* workarea smaller than the monitor.
*/
if (meta_prefs_get_force_fullscreen() &&
(window->decorated || !meta_window_is_client_decorated (window)) &&
(!window->decorated && !meta_window_is_client_decorated (window)) &&
meta_rectangle_equal (&rect, &xinerama_info->rect) &&
window->has_fullscreen_func &&
!window->fullscreen)
Expand Down

0 comments on commit c070bfa

Please sign in to comment.