bakkeby / dwm-flexipatch

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

BAR_SYSTRAY_PATCH and XRDB_PATCH colour issue #429

Open Ampnbsp opened 6 days ago

Ampnbsp commented 6 days ago

When I update dwm colours with dwmc xrdb, the system tray icons keep the old background colour, but not the new one.

bakkeby commented 6 days ago

I can imagine that happening. I take it that this is specifically when not using the alpha patch?

Ampnbsp commented 6 days ago

Yes, my full patchlist is:

#define BAR_DWMBLOCKS_PATCH 1
#define BAR_LAYOUTMENU_PATCH 1
#define BAR_LTSYMBOL_PATCH 1
#define BAR_STATUS_PATCH 1
#define BAR_STATUSCMD_PATCH 1
#define BAR_SYSTRAY_PATCH 1
#define BAR_TAGS_PATCH 1
#define BAR_WINTITLE_PATCH 1
#define BAR_EXTRASTATUS_PATCH 1
#define BAR_EWMHTAGS_PATCH 1
#define BAR_HIDEVACANTTAGS_PATCH 1
#define BAR_NO_COLOR_EMOJI_PATCH 1
#define BAR_STATUSALLMONS_PATCH 1
#define ALWAYSCENTER_PATCH 1
#define AUTOSTART_PATCH 1
#define AUTORESIZE_PATCH 1
#define CFACTS_PATCH 1
#define DRAGCFACT_PATCH 1
#define DRAGMFACT_PATCH 1
#define DWMC_PATCH 1
#define FAKEFULLSCREEN_CLIENT_PATCH 1
#define FOCUSONCLICK_PATCH 1
#define FOCUSONNETACTIVE_PATCH 1
#define LOSEFULLSCREEN_PATCH 1
#define MONITOR_RULES_PATCH 1
#define MOVESTACK_PATCH 1
#define NET_CLIENT_LIST_STACKING_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 RENAMED_SCRATCHPADS_PATCH 1
#define RESIZEPOINT_PATCH 1
#define RESTARTSIG_PATCH 1
#define SAVEFLOATS_PATCH 1
#define SEAMLESS_RESTART_PATCH 1
#define SELFRESTART_PATCH 1
#define SENDMON_CENTER_PATCH 1
#define SENDMON_KEEPFOCUS_PATCH 1
#define SHIFTTAG_PATCH 1
#define SHIFTVIEW_CLIENTS_PATCH 1
#define STEAM_PATCH 1
#define STICKY_PATCH 1
#define SWALLOW_PATCH 1
#define SWAPFOCUS_PATCH 1
#define SWITCHTAG_PATCH 1
#define TAGMONFIXFS_PATCH 1
#define TOGGLEFULLSCREEN_PATCH 1
#define VIEW_HISTORY_PATCH 1
#define WINVIEW_PATCH 1
#define XRDB_PATCH 1
#define ZOOMSWAP_PATCH 1
#define BSTACKHORIZ_LAYOUT 1
#define DECK_LAYOUT 1
#define GAPPLESSGRID_LAYOUT 1
#define TILE_LAYOUT 1
#define MONOCLE_LAYOUT 1
bakkeby commented 6 days ago

It is an interesting problem. I added some proposed changes, let me know if that works for you.

Happy to discuss if someone has better ideas for how to address systray icon window redraw issues.

Ampnbsp commented 4 days ago

I tried this fix, but it did not help. Background updates only when the icon updates (e.g. new unread message counter update in Telegram), but not with xrdb instantly.

bakkeby commented 4 days ago

I tried with Telegram and I was not able to replicate. Maybe it depends on how it is installed and if it is packaged (for me telegram-desktop is installed as a straight binary, Arch AUR).

In any case the window manager does not have any direct control over the content of windows, so if the application does not redraw the systray icon following an Expose event then I am not sure if there is anything that can be done to force a redraw of the icon.

You should be able to test this by using the keybinding of MOD+b to hide the bar and once more to show the bar again. If the systray icon does not update then it is possible that the application does not react to Expose events for the systray icon. Worth checking with multiple systray applications to see if only one is affected or all of them.

There are two workarounds that I can think of: