bakkeby / dwm-flexipatch

A dwm build with preprocessor directives to decide which patches to include during build time
MIT License
1.17k stars 239 forks source link

Strange fullscreen behavior #391

Open Ampnbsp opened 12 months ago

Ampnbsp commented 12 months ago

When I start a program in fullscreen mode I cannot exit from fullscreen properly.

My patches:

define BAR_DWMBLOCKS_PATCH 1

define BAR_LTSYMBOL_PATCH 1

define BAR_STATUS_PATCH 1

define BAR_STATUSCMD_PATCH 1

define BAR_STATUS2D_XRDB_TERMCOLORS_PATCH 1

define BAR_SYSTRAY_PATCH 1

define BAR_TAGS_PATCH 1

define BAR_WINTITLE_PATCH 1

define BAR_HIDEVACANTTAGS_PATCH 1

define BAR_NO_COLOR_EMOJI_PATCH 1

define AUTOSTART_PATCH 1

define AUTORESIZE_PATCH 1

define CFACTS_PATCH 1

define DWMC_PATCH 1

define FAKEFULLSCREEN_CLIENT_PATCH 1

define LOSEFULLSCREEN_PATCH 1

define MOVESTACK_PATCH 1

define NET_CLIENT_LIST_STACKING_PATCH 1

define NOBORDER_PATCH 1

define NODMENU_PATCH 1

define NO_MOD_BUTTONS_PATCH 1

define NO_TRANSPARENT_BORDERS_PATCH 1

define PERTAG_PATCH 1

define PLACEMOUSE_PATCH 1

define RESIZEPOINT_PATCH 1

define RESTARTSIG_PATCH 1

define SAVEFLOATS_PATCH 1

define SCRATCHPADS_PATCH 1

define SCRATCHPADS_KEEP_POSITION_AND_SIZE_PATCH 1

define SEAMLESS_RESTART_PATCH 1

define SHIFTTAG_PATCH 1

define SHIFTVIEW_CLIENTS_PATCH 1

define STICKY_PATCH 1

define SWALLOW_PATCH 1

define TOGGLEFULLSCREEN_PATCH 1

define XRDB_PATCH 1

define BSTACK_LAYOUT 1

define DECK_LAYOUT 1

define TILE_LAYOUT 1

define MONOCLE_LAYOUT 1

My keybindings:

    { MODKEY,                                 XK_f,          togglefullscreen,       {0} },
    { MODKEY|ShiftMask,             XK_f,          togglefakefullscreen,   {0} },
    { MODKEY,                                 XK_q,          killclient,             {0} },
    { MODKEY,                                 XK_t,          setlayout,              {.v = &layouts[0]} }, //TILE

https://github.com/bakkeby/dwm-flexipatch/assets/41110719/a7e45871-35fa-497e-b309-9013b5147b8d

bakkeby commented 12 months ago

Hmm, doing an arrange rather than restack here solves that issue.

https://github.com/bakkeby/dwm-flexipatch/blob/4a22fd046cdeb53899eb23f81607287244dcdfdb/dwm.c#L3544

The cause seems to be that the window has the _NET_WM_STATE_FULLSCREEN atom set when the window is first mapped, which results in the manage function to make the client fullscreen. This has the side effect that the client becomes floating before the arrange is triggered which means that the client does not have any tiled size to revert to when fullscreen is exited.

I think this needs a bit more analysis before patching.